Adding info from a database to a DataGrid

Discussion in 'Visual Basic ( VB )' started by bouki, Mar 13, 2011.

  1. bouki

    bouki New Member

    Joined:
    Apr 9, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    I have selected the info that i want from my database but im unaware of the syntax need to be used to add them to the datagrid.

    The datagrid has the column...BookName, DateRetun and DateIssued. Can anyone tell me how to approach this please.

    Code:
      cn.ConnectionString = "data source = Rayon\Rayon; initial catalog = library; uid=sa; password=minnie"
            cn.Open()
            cmd.Connection = cn
            cmd.CommandType = cmd.CommandText
            cmd.CommandText = " select BookName, DateIssued, DateReturn from Book, BookReturn, BookBorrow" & "where " bookreturn.isbnno = Book.ISBNno and  BookBorrow.ISBNno = Book.ISBNno"
            rdr = cmd.ExecuteReader
    
     
  2. virxen

    virxen Active Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    28

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice