473,931 Members | 12,975 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help fast, DataSet question!

I'm trying to copy data from two tables in a Source db into two Tables in a
Destination db and the Tables designa are the same.

I created 4 adapters...

2 for the two tables in the source db
2 for the 2 tables in the destination db

Then I filled a SourceDataSet with the Source adapters

and then I update the destination adapters with the SourceDataset.

But the information is not copied, what can I do???

I need help really fast, please!

/Lars
Nov 20 '05 #1
13 1292
Hi Lars,

First of all, we try to learn as well from this newsgroup and like to have
some feedback on questions.

I don't know how it is with others, however when I give an answer I get the
idea, that you never read it.

To give an answer on your question. What do you mean with copy because I get
the idea because you are talking about a dataadapter, that it is not this
code?

dim datasetNew as new dataset = datasetOld.copy

Cor
Nov 20 '05 #2
Okay I have this code!

Private Sub Importdata()

Try

dsDestination = dsSource.Copy

adpDestinationD isk.Update(dsDe stination, "Disktable" )

adpDestinationE vent.Update(dsD estination, "Eventtable ")

Catch ex As Exception

MsgBox(ex.Messa ge)

End Try

DataGrid2.DataS ource = dsDestination

End Sub
I dataset is updated alright but the changes are never written into the
Database associated with the Destination adapters.

I don't get any error, the Update Just does'nt seem to happen. But the
Datagrid shows the dataset fine.

And about the first thign you wrote, you mean I never say thank you or you
mean I don't answer questions?

I do both, but as you probably have noticed, i'm not that good yet and most
questions I have no idea abotu how to answer.

I'm very thankful I get answers in here, it's helping me a lot!

/Lars


"Cor Ligthert" <no**********@p lanet.nl> skrev i meddelandet
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi Lars,

First of all, we try to learn as well from this newsgroup and like to have
some feedback on questions.

I don't know how it is with others, however when I give an answer I get the idea, that you never read it.

To give an answer on your question. What do you mean with copy because I get the idea because you are talking about a dataadapter, that it is not this
code?

dim datasetNew as new dataset = datasetOld.copy

Cor

Nov 20 '05 #3
Hi Lars,

Am I right that the second update does not work and the first does.

The dataadapter has an automaticly accept.changes in it with a full dataset.
So all rowstates will be set as done and your second update *should* never
work.

If this does not answer your question, reply?

Cor
Nov 20 '05 #4
You might be on to something here.. I never thought about that the second
update might never happen and that will explain why the database in not
updated I guess.. but what can I do About this?

Why "should" it not work?
/Lars

"Cor Ligthert" <no**********@p lanet.nl> skrev i meddelandet
news:O1******** ******@tk2msftn gp13.phx.gbl...
Hi Lars,

Am I right that the second update does not work and the first does.

The dataadapter has an automaticly accept.changes in it with a full dataset. So all rowstates will be set as done and your second update *should* never
work.

If this does not answer your question, reply?

Cor

Nov 20 '05 #5
Hi Lars.

I think you can try to use a copy dataset to update, or you can do the
first update using dataset.getchan ges because I saw than the datarowsetting
is not changed. However I am not sure if that last is as it should be or
that it is a bug and when it is the last you can get problems in future, I
am not using that one anymore.

Have a look at this article for the working of the update, in my opinion it
describes that very well.

http://msdn.microsoft.com/library/de...pdatetopic.asp

(Did you look at the command haschanges too, it is very usefull)
if dataset.haschan ges then
update
end if

If not clear, reply?

Cor
Nov 20 '05 #6
Still don't get it.

I mean... My Datasets are all updated Fine... but Not the adapters, but the
don't give me any error!

/Lars

"Cor Ligthert" <no**********@p lanet.nl> skrev i meddelandet
news:Ow******** ******@TK2MSFTN GP12.phx.gbl...
Hi Lars.

I think you can try to use a copy dataset to update, or you can do the
first update using dataset.getchan ges because I saw than the datarowsetting is not changed. However I am not sure if that last is as it should be or
that it is a bug and when it is the last you can get problems in future, I
am not using that one anymore.

Have a look at this article for the working of the update, in my opinion it describes that very well.

http://msdn.microsoft.com/library/de...pdatetopic.asp
(Did you look at the command haschanges too, it is very usefull)
if dataset.haschan ges then
update
end if

If not clear, reply?

Cor

Nov 20 '05 #7
I have gone the booring way now... I fiuxed it wil ExecuteNOnQuery s and
wrote the Updates myself.. I have fixed my "mission" but not in the way I
wanted and I still dont' get why I can't

Fill one Dataset with one adapter... copy it and then use the DatasetCopy to
update the another adapter.

/Lars
"Lars Netzel" <[no_spam_please]la*********@qlo gic.se> skrev i meddelandet
news:%2******** *******@tk2msft ngp13.phx.gbl.. .
Still don't get it.

I mean... My Datasets are all updated Fine... but Not the adapters, but the don't give me any error!

/Lars

"Cor Ligthert" <no**********@p lanet.nl> skrev i meddelandet
news:Ow******** ******@TK2MSFTN GP12.phx.gbl...
Hi Lars.

I think you can try to use a copy dataset to update, or you can do the
first update using dataset.getchan ges because I saw than the

datarowsetting
is not changed. However I am not sure if that last is as it should be or
that it is a bug and when it is the last you can get problems in future, I am not using that one anymore.

Have a look at this article for the working of the update, in my opinion

it
describes that very well.

http://msdn.microsoft.com/library/de...pdatetopic.asp

(Did you look at the command haschanges too, it is very usefull)
if dataset.haschan ges then
update
end if

If not clear, reply?

Cor


Nov 20 '05 #8
When I use the HasChanges check it seems the dataset is actually not
updated.. It never goes into my IF statement although dsDestination is
originally Empty and the dsSource.Copy is not giving an error...

Private Function Importdata() As Boolean
Try
dsDestination = dsSource.Copy
If dsDestination.H asChanges Then
adpDestinationD isk.Update(dsDe stination, "Disktable" )
adpDestinationE vent.Update(dsD estination, "Eventtable ")
DestinationGrid .DataSource =
dsDestination.T ables("Eventtab le")
Return True
Else
DestinationGrid .DataSource() =
dsDestination.T ables("Eventtab le")
End If
Catch ex As Exception
MsgBox(ex.Messa ge)
Return False
End Try

/Lars
"Lars Netzel" <[no_spam_please]la*********@qlo gic.se> skrev i meddelandet
news:uV******** ******@tk2msftn gp13.phx.gbl...
I have gone the booring way now... I fiuxed it wil ExecuteNOnQuery s and
wrote the Updates myself.. I have fixed my "mission" but not in the way I
wanted and I still dont' get why I can't

Fill one Dataset with one adapter... copy it and then use the DatasetCopy to update the another adapter.

/Lars
"Lars Netzel" <[no_spam_please]la*********@qlo gic.se> skrev i meddelandet
news:%2******** *******@tk2msft ngp13.phx.gbl.. .
Still don't get it.

I mean... My Datasets are all updated Fine... but Not the adapters, but the
don't give me any error!

/Lars

"Cor Ligthert" <no**********@p lanet.nl> skrev i meddelandet
news:Ow******** ******@TK2MSFTN GP12.phx.gbl...
Hi Lars.

I think you can try to use a copy dataset to update, or you can do the first update using dataset.getchan ges because I saw than the

datarowsetting
is not changed. However I am not sure if that last is as it should be or that it is a bug and when it is the last you can get problems in future, I
am not using that one anymore.

Have a look at this article for the working of the update, in my
opinion it
describes that very well.

http://msdn.microsoft.com/library/de...pdatetopic.asp
(Did you look at the command haschanges too, it is very usefull)
if dataset.haschan ges then
update
end if

If not clear, reply?

Cor



Nov 20 '05 #9
Hi Lars,

What is the code before that, where you put the changes in the dataset.
The most made mistake is that people put an dataset.acceptc hanges somewhere
before the update, what means that all updates will be set as done.

Cor
Nov 20 '05 #10

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

Similar topics

8
2906
by: Neil | last post by:
I have a very puzzling situation with a database. It's an Access 2000 mdb with a SQL 7 back end, with forms bound using ODBC linked tables. At our remote location (accessed via a T1 line) the time it took to go to a record was very slow. The go to mechanism was a box that the user typed the index value into a combo box, with very simple code attached: with me.RecordsetClone .FindFirst " = " & me.cboGoTo If Not .NoMatch Then Me.Bookmark...
4
1658
by: Steve Klett | last post by:
(I posted this in ADO group, but I think this group will be better) Hi- I need to develop an FAQ section for our website. We would like to break up the FAQ by products, then categories with each category having n question/answer pairs. I would like to pass parameters in the querystring based on what the product/category the user selected, then populate a datagrid with the correct set of question/answer
15
1232
by: scorpion53061 | last post by:
I have a time critical function I need assistance with. You should be familiar with windows forms, ADO.NET and MS Word Automation. If you are interested please email me at kjmnospamhereplease@charter.net remove the nospamhereplease
2
1468
by: -=JLK=- | last post by:
All, I'm looking for opinions on the best way to accomplish a given task. Here is the senario: I have a Data Warehouse that I need to update with information that has been loaded into a staging database. We are dealing only with three tables (a source table, and the destination dimension and fact). I need to process each "new" record in the source (staging) table, transform the data and then update or insert into the dimension table...
3
1369
by: mateo | last post by:
Hello i would like to have advices on an ASP.NET 2 application that i must develop. I'm new to ASP.NET, i am more of WinApp developper, so if there is some experienced folks out there all advices are welcome. So there it is, i'm developping an asp application that will be accessed by many workers in a company. The app is basically dealing with parts and customers (we sell pieces off all kind and we have lot's of customers). My database...
1
1975
by: batista | last post by:
Hello all, I have a third praty grid control...named C1grid. Im using it in one of my apps.. Now, I have bind this grid to a custom dataset class named "DataViewEx". The code of the class is below... Now what happens is that im updating this dataviewex class from a separate thread.....
1
1386
by: Richard Lewis Haggard | last post by:
I need to get up to speed on the new dataset object fast. Can someone recommend a primer or other highly condensed tutorial that will give me an intense injection of practical knowledge on how datasets work? In particular, I know that a dataset can contain multiple tables but can a dataset encapsulate hierarchical data arrangements? The particular application that my company wants me to investigate is if it is practical to use a dataset...
12
1219
by: Boris Ozegovic | last post by:
Hi, I am working on some system, and the communication will take place through the chatterbot which will be written in AIML (interpreter is written in Python). English is not my mother tongue, so I need huge favor: if all of you can write two sentences, so that I could have greater pattern base. The first sentence is finding someone's heart rate, example: "Please, can you tell me John's heart rate", and the other one is setting the...
5
3697
by: ElPresidente | last post by:
Now that I have your attention haha... I have this weekly file that contains several hundred invoices that need to be given batch letters in according to the following hierarchy. Employee -Division -Customer -Product Type -Expense Code I had previously programmed a working version in Python that successfully did this by putting those 5 categories into 5 nested for
0
9953
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11496
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11256
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9840
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7359
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6264
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4887
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4431
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3483
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.