retrieve selected data from SQL database using vb.net

I already watch the video in the vb.net express to learn about the data binding. But the problem that i face is when i want to retrieve certain data from the database. the video just show how to fill and update. who ever know the code to retrieve the selected row from the SQL database using vb.net 2005 thanks




Answer this question

retrieve selected data from SQL database using vb.net

  • Jeff Siegel

    There are a number of ways to do it but a SQL data reader is one way

    http://www.developerfusion.co.uk/show/4278/2/

    You can use a dataadapter and simply change the SQL statement so that it picks up a single record - a dataset can consist of only one record. And you don't have to bind the dataset to controls.

    Again you can probramatically create the tabledatapter, command etc.

    A simple web search on VB + SQLdatareader will reveal a large number of articles


  • Jim198

    Fill is what you use to retrieve a row from SQL, using a data grid control.

    The easiest thing is to set the data source as a SQL query, Using for example,

    Select * From MyTable Where MyField = 'MyCriteria'

    If you do not want to use the grid, or data bound controls, then use a SqlDataReader (or an OLE Data Reader if not using SQL Server)


  • retrieve selected data from SQL database using vb.net