472,127 Members | 1,424 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

want to get data from datagrid

Dear all

I am working on c#.net 2003 version

Making a window application in connection with sql database

what I need is i displayed the data in datagrid

if somebody select the row then the data of that row comes in variables

Wat i can do i didn't understand
is somebody help me regarding this

my email is nj.nikhiljain@gmail.com
Dec 8 '06 #1
3 12260
bhar
37
Dear all

I am working on c#.net 2003 version

Making a window application in connection with sql database

what I need is i displayed the data in datagrid

if somebody select the row then the data of that row comes in variables

Wat i can do i didn't understand
is somebody help me regarding this

my email is nj.nikhiljain@gmail.com

Hi,

I have done like this:

We can create a DataTable temporarily to hold data from the query result and bind it to the DataGrid using the following statement.
(DataGrid1.DataSource=dtbuser , here dtbuser is DataTable.

To display values from the grid to the varaibles,

if dtbuser.Rows.Count)=0 Then

text1.text=dtbuser.Rows(DataGrid1.CurrentRowIndex) .Item(0)

End If

TRy this book ,"Database programming using vb.net and sql server", [Link Removed]
This book deals with Datagrid programming extensively(Add ,modify,delete etc)

Regards
Madhav
Dec 11 '06 #2
same as the above

but try this

text1=datagrid1(currentrowindex,currentcolumnindex ).item.text

in the datagrid_selectedindex changed
Dec 11 '06 #3
Hi siricharan82 & Madhav

Thanks for the help
It Solve My Problem

Thanks & Regards
Nikhil
Dec 11 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by vinayak | last post: by
reply views Thread by lucas | last post: by
2 posts views Thread by Andy Sutorius | last post: by
7 posts views Thread by Brian Henry | last post: by
6 posts views Thread by Hutty | last post: by
1 post views Thread by pv_kannan | last post: by
4 posts views Thread by Peter | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.