Click here to Skip to main content
15,922,419 members
Home / Discussions / C#
   

C#

 
GeneralRe: Uncloseable window Pin
Dan Neely2-Jul-07 2:01
Dan Neely2-Jul-07 2:01 
QuestionWebService Query Pin
Iftekhar Naim1-Jul-07 21:43
Iftekhar Naim1-Jul-07 21:43 
AnswerRe: WebService Query Pin
nitikin2-Jul-07 0:22
nitikin2-Jul-07 0:22 
QuestionNameValueCollection.GetValues(string Key) Pin
SakthiSurya1-Jul-07 21:18
SakthiSurya1-Jul-07 21:18 
Questiondesign time element support [modified] Pin
Matglas1-Jul-07 20:52
Matglas1-Jul-07 20:52 
QuestionDataGridView:Retrieve the first column of the selected row Pin
Waskira1-Jul-07 20:46
Waskira1-Jul-07 20:46 
AnswerRe: DataGridView:Retrieve the first column of the selected row Pin
sidbaruah1-Jul-07 21:26
sidbaruah1-Jul-07 21:26 
GeneralRe: DataGridView:Retrieve the first column of the selected row Pin
Waskira1-Jul-07 22:02
Waskira1-Jul-07 22:02 
Hi,thanks for the quick response
Am using windows forms no ASP.NET.

to load the current row selected in the datagridview

int CustomerID = int.Parse(dataGridView1[dataGridView1.CurrentCellAddress.Y, 0].ToString());
customer customer = customerManager.GetCustomer(customerID);

then i fill the respective textboxes with data from that cell

txtcustomerID.Text = customer.CustomerID.ToString();
txtname.Text = customer.CompanyName;

the GetCustomer() method's definition is

public static customer GetCustomer(System.Int32 CustomerID)
{
string ConnectionString = "Server = (local);Integrated Security = SSPI ;Initial Catalog = pos";
string query = "Select * from CompanyProfile where CustomerId " + CustomerID;

DataTable dt = DataManager.ExecuteQuery(ConnectionString, query, "customer");
if (dt.Rows.Count == 0)
{
return null;
}
return new customer(dt.Rows[0]);
}

But when i run the Program and click in one of the cells,I get an error saying Input string is not in the correct format.
and the customerID value is 0 in that case though the value in the Database is 1.


The nature of your experience depends on your point of view.

GeneralRe: DataGridView:Retrieve the first column of the selected row [modified] Pin
Waskira1-Jul-07 22:48
Waskira1-Jul-07 22:48 
QuestionSerial Program I dont understand Pin
mercenary011-Jul-07 20:09
mercenary011-Jul-07 20:09 
QuestionHow to Call a delay with C# Pin
mercenary011-Jul-07 19:46
mercenary011-Jul-07 19:46 
AnswerRe: How to Call a delay with C# Pin
Martin#1-Jul-07 19:50
Martin#1-Jul-07 19:50 
AnswerRe: How to Call a delay with C# Pin
Sathesh Sakthivel1-Jul-07 19:50
Sathesh Sakthivel1-Jul-07 19:50 
QuestionDebuging in VS2005 Pin
Glen Harvy1-Jul-07 19:38
Glen Harvy1-Jul-07 19:38 
AnswerRe: Debuging in VS2005 Pin
Vikram A Punathambekar1-Jul-07 20:05
Vikram A Punathambekar1-Jul-07 20:05 
GeneralRe: Debuging in VS2005 Pin
Glen Harvy1-Jul-07 20:20
Glen Harvy1-Jul-07 20:20 
GeneralRe: Debuging in VS2005 Pin
Martin#1-Jul-07 20:11
Martin#1-Jul-07 20:11 
GeneralRe: Debuging in VS2005 Pin
Vikram A Punathambekar1-Jul-07 23:46
Vikram A Punathambekar1-Jul-07 23:46 
GeneralRe: Debuging in VS2005 Pin
Vikram A Punathambekar1-Jul-07 23:48
Vikram A Punathambekar1-Jul-07 23:48 
GeneralRe: Debuging in VS2005 Pin
Martin#1-Jul-07 23:49
Martin#1-Jul-07 23:49 
AnswerRe: Debuging in VS2005 Pin
sidbaruah1-Jul-07 21:28
sidbaruah1-Jul-07 21:28 
QuestionWindows Service as a host application in Remoting Pin
M. J. Jaya Chitra1-Jul-07 19:22
M. J. Jaya Chitra1-Jul-07 19:22 
AnswerRe: Windows Service as a host application in Remoting Pin
Sathesh Sakthivel1-Jul-07 19:27
Sathesh Sakthivel1-Jul-07 19:27 
QuestionRe: Windows Service as a host application in Remoting Pin
M. J. Jaya Chitra1-Jul-07 19:39
M. J. Jaya Chitra1-Jul-07 19:39 
AnswerRe: Windows Service as a host application in Remoting Pin
Sathesh Sakthivel1-Jul-07 19:43
Sathesh Sakthivel1-Jul-07 19:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.