Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
dear engenners

when i get integer values from datatable that has rows and casting it to appear in label , give me a null
label3.Text = totalmoney.Rows[0][0].ToString();


and when change the query to get the string value with this code , it give me the value
so i think i have a invalid cast or any thing like this ,,, can any one help me
Posted
Comments
Richard C Bishop 25-Apr-14 12:48pm    
Just remove one of the "[0]" from the Rows. You should only need one.
ccalma 25-Apr-14 22:29pm    
Did you check your datatable if it has a value?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900