Need help with Datagrids

nazmul

New member
Joined
Jul 15, 2005
Messages
2
Programming Experience
Beginner
Hi,

I have very little experience with programming and am only getting to grips with very basic concepts.

I am using Visual Studio.net 2003, and using a VB.net to make window forms.
I am also using Access as my database (I will upgrade to SQL 2000 when i have more money).

However, my problem is that i have made a form which conatins a data grid to display the fields value of a table in made in access.

I am finding it difficult to connect the datagrid to the table and display the data in the table.

Basically, i am lost and have spent over six hours in trying figure it out.

Can someone please advise me on how should go about it.

Regards,


nazmul
 
DataBindings

Once you have established a DataAdapter (OleDbDataAdapter) and Dataset on the form, it is a matter of binding the DataGrid to the Dataset. The 'properties' of the datagrid include a DataBindings section. Set the DataSource to the dataset created throught the DataAdapter and set the DataMember to the table name of the DataSet.

All of this can be quickly and easily done for you by using the DataForm wizard located under 'FILE' - 'Add New Item'.

The wizard will step you through the process of creating a datagrid based form and provide the code used to add, update, and delete from a dataset. I suggest using the wizard to familiarize yourself with the code and concepts of this type of form before trying to code from scratch.

hope that helps.
 
David,

Thank you for help and advise.

I have tried your suggestion of using the data wizard, and this works fine.
I am trying to understand the code as you suggested.

Thanks

Nazmul
 
If you intend to upgrade to SQL Server later anyway, I would suggest that you start using MSDE now instead of Access. MSDE is a free, cut-down version of SQL Server that you can download from Microsoft. As far as your VB code is concerned, MSDE IS SQL Server, so you can write code yourself and test it on MSDE, and then distribute it to users with SQL Server. You can also redistribute MSDE yourself to users who don't want to pay for SQL Server.
 
Back
Top