Solved

VB.net save a DataRow after adding it to a DataTable

Posted on 2015-01-05
2
189 Views
Last Modified: 2015-01-06
Hi

If a DataTable is pulled from a SQL database table and a new row added with code
like that below. How do you save the new DataRow back to the SQL database

Dim newCustomersRow As DataRow = DataSet1.Tables("Customers").NewRow()

newCustomersRow("CustomerID") = "ALFKI"
newCustomersRow("CompanyName") = "Alfreds Futterkiste"

DataSet1.Tables("Customers").Rows.Add(newCustomersRow)
0
Comment
Question by:murbro
2 Comments
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 40531892
YourDataAdopter.Update(DataSet1)

Where YourDataAdopter is the instance of the DataAdopter you used.
0
 

Author Closing Comment

by:murbro
ID: 40533343
Thanks
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now