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

datagrid access by column and row

hi everybody,
I'm looking everywhere to find out a way to access a specific column and row of a datagrid generated by a sql-query in visual basic.

The datagrid looks, simplified, like this:

column1 column2
data1 data2

now I would need a function, that reads data2 out in visual basic (asp.net web)

any help would be very appreciated ;-)

thanks in advance
Georges-Louis

georges-louis
Newbie Poster
4 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

HI,

Assign the data source of the data grid to a DataTable, and access the Data from the data table. Please find the code snippet below.

Dim dtTable As DataTable = dgGrid.DataSource()
 Dim strVal As String = dtTable.Rows(0)(0).ToString()

You can get the value of the first row, first column in the variable strVal.

saravind84
Newbie Poster
22 posts since Aug 2010
Reputation Points: 12
Solved Threads: 6
 

hi saravind84,
it work, thanks a lot for your help :)
Cheers
Georges-Louis

georges-louis
Newbie Poster
4 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: