Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Need Help With DataGridView
 

Need Help With DataGridView

I have set up an application that is a simple frontend for a local db in the app. The db is called projectdb. I have a form on which there is a DataGridView called DataGridView1. It is linked to "user" table of the db. There is a button, button2, that i have added. I want to save the contents of the DataGridView to the db when the button is pressed. Plz help me.
Doomslagen  Sunday, April 05, 2009 5:55 PM

Hi Doomslagen,

When click save button, you can use dataAdapt to update the database.

The following links are for your reference:


Updating Data Sources with DataAdapters:
http://msdn.microsoft.com/en-us/library/33y2221y(VS.80).aspx

Modifying Data in ADO.NET:
http://msdn.microsoft.com/en-us/library/ms254950(VS.80).aspx

You can use SqlCommandBuilder class to automatically generate single-table commands that are used to reconcile changes made to a DataSet with the associated SQL Server database.

SQLCommandBuilder: http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommandbuilder.aspx

How to use Microsoft Visual Basic .NET to connect to a Microsoft Access database and to retrieve data?

If you have further questions, please feel free to tell me.

Best regards,
Ling Wang


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Saturday, April 11, 2009 11:40 AM
That is great. But now I have upgraded to visual studio 10, and there is no such thing as a tableadaptor. What do I do?

Doomslagen  Wednesday, August 19, 2009 9:32 PM
This feature was not removed, so your project should work fine in VS 2010.

Are you getting some type of error when you try to upgrade your project to VS 2010?
www.insteptech.com ; msmvps.com/blogs/deborahk
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
DeborahK  Wednesday, August 19, 2009 9:41 PM

You can use google to search for other answers

Custom Search

More Threads

• want to learn how to write code for different controls in windows forms
• If anyone can spare the time to help my cbo prob
• FormattableTextBoxColumn Not formatting a Currency
• Example for deriving from datagridviewcell
• Cascade combobox abnormally changes database field
• list box problem
• DataGridViewComboBoxColumn how to bind to child table?
• Linklabel in a Datagrid
• Where is the Forum for Asking about populating txtboxes from a database in Visual Studio 2005?
• Not able to get numeric value from SQL 2000 using VB.NET