0

Regards,

I have a weird problem with a variable in asp.net + C#.

Those lines work:

DataTable customerDT = service.GetCustomerDT(1);
dataRow["CustomerName"] = customerDT.Rows[0]["FullName"];

But those lines do not found anything even though the value of the variable is "1" too:

int customerID = int.Parse(gridViewRowVar.Cells[0].Text.ToString());
DataTable customerDT = service.GetCustomerDT(customerID);
dataRow["CustomerName"] = customerDT.Rows[0]["FullName"];

The big surprise, as I said before, is that:
I know that the value of the varible is also 1, and to check it I'v tried:

Response.Redirect(customerID.Equals(1).ToString());

It does return True!

But somehow the previous lines don't work.

Thanks to my experience I think it's essential "clean" the varible before using it,
but I don't know how to do this. In asp I think I have used something like: "Clng".

Did u understand me?
Could u help me plz?
Thanks!

Edited by Corpes: n/a

1
Contributor
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Corpes
0

pleaseee help me!!!!!!!!!!!!! i cant do anything!!!!!!!please!
even if u didnt understand or dont know just tell me, please~!

0

yeahhh, i found: i should have typed Cells[1] and not Cells[0]

Edited by Corpes: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.