Can anyone help me how to access for example value of first cell in 4th column?
a b c d
1 2 3 5
g n m l
for example, how to access to value d from a data table structured and filled as above?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you need a weak reference to the cell value:
or
Should do it
If you need a strongly typed reference (string in your case) you can use the DataRowExtensions.Field extension method:
(make sure System.Data is in listed in the namespaces in this case)
Indexes are 0 based so we first access the first row (0) and then the 4th column in this row (3)