save datagridview contents to access database  
Author Message
Xancholy





PostPosted: Visual C# General, save datagridview contents to access database Top

Can someone please show me how to dump the contents of a datagridview into a programmatically created access database

When I click a save button, an access database is created to hold the contents of datagridview1, with fields named according to datagridview1's column headers..

Thanks for any help


Visual C#17  
 
 
cverdon





PostPosted: Visual C# General, save datagridview contents to access database Top

Hi,

You have to bind the dataset's content to a dataset through the binding source object and call the table adapter's Update method.

If you also want to know how to create a new access db on the fly look into ADOX:
http://www.4guysfromrolla.com/webtech/013101-1.shtml

A whole bunch of good resources, including numerous books, that could really help you out:

ASP.NET 2.0: http://quickstarts.asp.net/QuickStartv20/aspnet/

Winforms: http://www.windowsforms.net/ and http://samples.gotdotnet.com/quickstart/winforms/

The online MSDN Developer's Guide for Windows Form Applications is also indispensible:

http://msdn2.microsoft.com/en-us/library/ms644558.aspx

They will all teach you the basics of databinding and data access.

Charles