Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
hey ,,
i have a data table
i want to get the value of the first Cell ( row :1 column : 1)
and then save this value to the string variable
pls help me
Posted
Comments
ZurdoDev 29-Oct-13 15:27pm    
dt.Rows[0][0]. Something like that.

1 solution

Just do this:

string result = dataTable.Rows[0][0].ToString();


That should do the trick!
 
Share this answer
 
Comments
seyed mahmud shahrokni 29-Oct-13 15:30pm    
ye thats my boy ,, i love u man , i love u...
Richard C Bishop 29-Oct-13 15:32pm    
You are quite welcome. Come back anytime!
Sergey Alexandrovich Kryukov 29-Oct-13 15:47pm    
How tricky! :-)
A 5.
—SA
Richard C Bishop 29-Oct-13 16:25pm    
Thank you SA! It took all of my wits and cunning to conjure up this eloquent solution.
Sergey Alexandrovich Kryukov 29-Oct-13 16:41pm    
:-)

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