954,577 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Selecting a single field in database

hi all...i'm a beginner in c#....
for selecting a field from database we use ds.Tables(0).Rows(0).item(0) in vb....
how can i do t same in c#.

shobitha
Newbie Poster
5 posts since Jan 2009
Reputation Points: 10
Solved Threads: 1
 

In C#, for selecting a single cell content from a dataset use:
ds.Tables[tableIndex].Rows[rowIndex][columnIndex].ToString();
So ds.Tables(0).Rows(0).item(0) in vb becomes
ds.Tables[0].Rows[0][0].ToString(); in C#

Aneesh_Argent
Junior Poster
104 posts since Dec 2008
Reputation Points: 16
Solved Threads: 18
 

thank u aneesh....
it worked.........

shobitha
Newbie Poster
5 posts since Jan 2009
Reputation Points: 10
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You