Home All Groups Group Topic Archive Search About

step by step guide to databinding?

Author
12 Apr 2005 11:25 AM
Doug
Hi,

Could you please provide me with a step approach to using the datagrid in
vb.net using visual studio 2003 Ent Arch edition

I would like to display the contents of an ms access table in my asp.net
page.

thanks

Doug

Author
12 Apr 2005 11:40 AM
Cor Ligthert
Doug,

See this, where there is asked about the dataadatper you need the
oledbdataadapter.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbwlkwalkthroughusingdatagridwebcontroltoreadwritedata.asp

I hope this helps,

Cor
Author
12 Apr 2005 2:02 PM
Philip Hristov
Hello,

After you setup the OleDBConnection object, OleDBDataAdapter and a
DataSet to show your table you have to perform you have to do this:

myConnection.Open 'Opens the connection
myDataAdapter.Fill(DataSet) 'Fills the DataSet with the data
MyDataGrid.DataSource = DataSet 'Sets the datasource from where we want
to get the data
MyDataGrid.DataBind 'the most important part, without calling the
DataBind method the DataGrid will not be shown
MyConnection.Close 'closes the connection

Also, you can check these samples about how to work with WEB DataGrid
in VB.NET -
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/ctrlref/webctrl/datagrid/doc_datagrid.aspx

Regards,

Philip