Re: commiting changes made to a typed dataset
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Mon, 16 Oct 2006 07:04:56 -0400
dimitrisX wrote:
hello,
i am writing an app in c# which reads data from Excel files and
submits them to an sqlserver database. the db is not going to be
modified by others during the excecution of the program. also the db
has many tables with complex relations.
1. i created a typed dataset of the datasource
2. the data read from an excel file are being inserted as new rows in
corresponding tables of the dataset
3. finally all the added rows have to be submitted to the datasource
the problem is i can't figure out how to do step 3: submit the changes
to the datasource. i thought there should be a way of synchronising
the dataset with the datasource in one move and in one place (i.e.
main() ). is that possible??
I'm confused: is the datasource of the dataset the Excel file or the sql
server database? Anyways ...
A quick read of the documentation at
http://msdn2.microsoft.com/en-us/library/system.data.dataset.aspx reveals
this statement:
4. Call the Update method of the DataAdapter, passing the second DataSet as
an argument.
So it appears you have to use a DataAdapter to update the database. If you
need to follow up on this:
There was no way for you to know it (except maybe by browsing through some
of the previous questions in this newsgroup before posting yours - always a
recommended practice) , but this is a classic ADO newsgroup. ADO.Net bears
very little resemblance to classic ADO so, while you may be lucky enough to
find a dotnet-knowledgeable person here who can answer your question, you
can eliminate the luck factor by posting your question to a group where
those dotnet-knowledgeable people hang out. I suggest
microsoft.public.dotnet.framework.adonet.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
.
- References:
- commiting changes made to a typed dataset
- From: dimitrisX
- commiting changes made to a typed dataset
- Prev by Date: commiting changes made to a typed dataset
- Next by Date: Re: MDAC 2.8 SDK
- Previous by thread: commiting changes made to a typed dataset
- Next by thread: Re: MDAC 2.8 SDK
- Index(es):
Relevant Pages
|