retrieve data from an sql server2000 into a datagrid view

patrick

Member
Joined
Aug 12, 2008
Messages
7
Programming Experience
3-5
I am relatively new to Vb.Net and i hope someone can help me up with this problem.... i have successfully connected my application to the database and was able to insert, delete and update the data... but the problem is that i can't retrieve the data into the datagridview or into a textbox or label...plz help me up with this...Thanks
 
Use a DataAdapter (or TableAdapter) to Fill a DataTable. Bind that DataTable to a BindingSource and then bind that to your control(s).
VB.NET:
myAdapter.Fill(myTable)
myBindingSource.DataSource = myTable
myGrid.DataSource = myBindingSource
myField.DataBindings.Add("Text", myBindingSource, "SomeColumn")
If you've created a Data Source and typed DataSet then you can set up the data-binding in the designer. In fact, you can drag tables and columns onto the form and the IDE will create the controls, BindingSource(s) and data-bindings for you.
 
I am relatively new to Vb.Net and i hope someone can help me up with this problem.... i have successfully connected my application to the database and was able to insert, delete and update the data... but the problem is that i can't retrieve the data into the datagridview or into a textbox or label...plz help me up with this...Thanks

Read the DW2 link in my signature, section Creating a Simple Data App
 

Latest posts

Back
Top