Adding info from a database to a DataGrid

Go4Expert Member
13Mar2011,15:17   #1
bouki's Avatar
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
Pro contributor
9Apr2011,03:57   #2
virxen's Avatar
http://www.vb-helper.com/howto_net_datagrid.html