473,395 Members | 1,521 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

save changes to datatable back to database

cj
Dim myExcelConnection As New
System.Data.OleDb.OleDbConnection("Provider=Micros oft.Jet.OLEDB.4.0;
Data Source=" & filename & "; Extended Properties=""Excel 8.0""")
Dim myExcelSqlCommand As String = "SELECT * FROM [all ANIs$]"
Dim myExcelAdapter = New
System.Data.OleDb.OleDbDataAdapter(myExcelSqlComma nd, myExcelConnection)
myExcelAdapter.fill(myExcelDt)
DataGridView1.DataSource = myExcelDt

Now assuming I've made changes to myExcelDt via the DataGrid how do I
save these back to the database?
Nov 16 '07 #1
2 2466
Hi CJ,

Updating is forever much more difficult then retrieving , just because that
you cannot use the wildcard * for it. You need the scheme.

For real databases which uses standard transact SQL script you can use the
commandbuilder, however not for Excel.

Here is exactly given with a sample how to do it with Excel.

http://support.microsoft.com/default...b;EN-US;316934

You can do it as well using Excel it self and then you get this.
http://www.vb-tips.com/DataGridViewExport.aspx

Cor

Nov 17 '07 #2
cj
Hi Cor,

I like your links. The second seems interesting but it didn't work.
Anyway I'm trying to keep this learning generic as what I learn here I
also need to apply to other Oledb databases--mostly Visual Fox Pro
tables. We do import a lot of CSV files into VFP tables and export a
lot of VFP tables to csv and VFP supports exporting straight to Excel as
well.

I believe now that the connection to excel is not going to be a good
test for using VFP tables so I'll probably create a few test tables to
play with.
Cor Ligthert[MVP] wrote:
Hi CJ,

Updating is forever much more difficult then retrieving , just because
that you cannot use the wildcard * for it. You need the scheme.

For real databases which uses standard transact SQL script you can use
the commandbuilder, however not for Excel.

Here is exactly given with a sample how to do it with Excel.

http://support.microsoft.com/default...b;EN-US;316934

You can do it as well using Excel it self and then you get this.
http://www.vb-tips.com/DataGridViewExport.aspx

Cor
Nov 19 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jaime | last post by:
I have to save a dataset to xml and for efficiency I like to get rid of the namespace prefix d2p1: can any one help thanks jaime
2
by: deko | last post by:
I create an XmlDataDocument Dataset when the main form of my WinForms app opens. The user will make changes to the Dataset, and then those changes should be saved to the XML file when the code...
14
by: Ron L | last post by:
All I am working with a DataGrid and a form consisting of a number of text, checkbox, combobox controls, all bound to the same datatable. When I click on my "New" button, I create a new row,...
1
by: ankz | last post by:
Hi Guys I have got 3 tables - in Access Database with Student ID as primary Key in all and all tables are linked with 1 to 1 relationship. I have code the everying with manual program to...
1
by: Benny | last post by:
I need to populate a table with information then in a seperate utility, in the same application, pull that data using the same criteria that was first used and update some values, unique to an id,...
6
by: Josetta | last post by:
Access 2003 I've been experiencing some problems with my "monster" database the last couple of days. I imported all objects into a new database yesterday, which pretty much stopped the crashing...
2
by: Ronald S. Cook | last post by:
In my client Windows application, I am receiving a DataSet containing one DataTable. This comes to my client via the business tier on a different physical machine (we're using WCF if that...
2
by: chike_oji | last post by:
Please can someone help me. I am writing a web application, that allows for the upload of an excel sheet into the database. I have an upload button and a save button. The upload button allows...
5
by: =?Utf-8?B?R3JlZw==?= | last post by:
I have a Datatable/Dataset that I'd like to update back to the server. How do I go about saving changes to my Datatable or Dataset back to the database?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.