Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   Adding info from a database to a DataGrid (http://www.go4expert.com/forums/adding-info-database-datagrid-t25236/)

bouki 13Mar2011 15:17

Adding info from a database to a DataGrid
 
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


virxen 9Apr2011 03:57

Re: Adding info from a database to a DataGrid
 
http://www.vb-helper.com/howto_net_datagrid.html


All times are GMT +5.5. The time now is 01:21.