want to get data from datagrid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nikhiljain
    New Member
    • Dec 2006
    • 2

    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@g mail.com
  • bhar
    Banned
    New Member
    • Apr 2006
    • 37

    #2
    Originally posted by Nikhiljain
    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@g mail.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.Data Source=dtbuser , here dtbuser is DataTable.

    To display values from the grid to the varaibles,

    if dtbuser.Rows.Co unt)=0 Then

    text1.text=dtbu ser.Rows(DataGr id1.CurrentRowI ndex).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
    Last edited by Frinavale; Apr 27 '07, 02:46 PM. Reason: Link was removed because it is considered spam and its content is not typical HTML

    Comment

    • siricharan82
      New Member
      • Sep 2006
      • 20

      #3
      same as the above

      but try this

      text1=datagrid1 (currentrowinde x,currentcolumn index).item.tex t

      in the datagrid_select edindex changed

      Comment

      • Nikhiljain
        New Member
        • Dec 2006
        • 2

        #4
        Hi siricharan82 & Madhav

        Thanks for the help
        It Solve My Problem

        Thanks & Regards
        Nikhil

        Comment

        Working...