473,326 Members | 2,655 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,326 software developers and data experts.

Disconected Dataset & dataTable

Hi everybody,

I have datatable and stored in dataset. The dataset Never connect to datasource before. How can I move mydata in dataset into the table in data souce? For instance my table say it Temp_table have fields EmpID, Name and age and my Table in datasource, say it Origin_Table have the same field. Then I add 5 data into Temp_Table. I want 5 data move into origin_table at the same time.

Is there some one want to help me, please?


Nov 18 '05 #1
3 1050
"Wance" <Wa***@discussions.microsoft.com> wrote in message
news:A7**********************************@microsof t.com...
Hi everybody,

I have datatable and stored in dataset. The dataset Never connect to

datasource before. How can I move mydata in dataset into the table in data
souce? For instance my table say it Temp_table have fields EmpID, Name and
age and my Table in datasource, say it Origin_Table have the same field.
Then I add 5 data into Temp_Table. I want 5 data move into origin_table at
the same time.

You would use the exact same technique you would have used if the DataSet
had originally been filled from the database: use a DataAdapter and use the
Update method of the DataAdapter.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #2
John,

Thank for your response, but I am still confused how to work with
disconected data. I 've created disconected dataset and table. Then I create
DataGrid to display data that added in form. If finish add data, I want to
send data to table in SQL Server database. My Table in SQL Server have
automatic number field. Say it "GatepassID", but in my disconected table I
don't give the "gatepassID" value, cause it will generate by SQL Server when
I update data from disconected table to table in SQL Server.

I want after user add data into disconected table and store into SQL Table
they will get new number ("gatepassID") generated by SQL so the data will
always consistence.

how method should I make?

Thank and Regards
wawan
Nov 18 '05 #3
I'm on the run, so don't have time for a better answer right now:

I've seen code where the disconnected table has the "ID" field defined as
autonumber(-1,-1) even though it's defined as autonumber(1,1) in the
database. This way, while disconnected, you'll get ID numbers in a totally
different range from the real ones in the database.

These will be ignored when you update to the database, and replaced with the
real, positive ID numbers.

There is some trick I'll need to look up, which reads back the "final" ID
values after the update is done to the database, and updates the in-memory
table with the "real" value. Apparently, it can also update any related
in-memory tables as well. I'll try to dig that up for you, but it may take a
day or so.
--
John Saunders
johnwsaundersiii at hotmail

"Wance" <Wa***@discussions.microsoft.com> wrote in message
news:57**********************************@microsof t.com...
John,

Thank for your response, but I am still confused how to work with
disconected data. I 've created disconected dataset and table. Then I create DataGrid to display data that added in form. If finish add data, I want to
send data to table in SQL Server database. My Table in SQL Server have
automatic number field. Say it "GatepassID", but in my disconected table I
don't give the "gatepassID" value, cause it will generate by SQL Server when I update data from disconected table to table in SQL Server.

I want after user add data into disconected table and store into SQL Table
they will get new number ("gatepassID") generated by SQL so the data will
always consistence.

how method should I make?

Thank and Regards
wawan

Nov 18 '05 #4

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

Similar topics

1
by: gro.asumsa | last post by:
I have two DataTables in a DataSet. I would like to create a third DataTable in the same DataSet that is a Join of the two original DataTables. The two tables are extracted from two different...
4
by: Frnak McKenney | last post by:
I'm using an in-core DataSet as an image of my application's 'database' (a multi-table Access97 mdb file). Updates are made to the DataTables within the DataSet via forms with bound TextBoxes,...
3
by: Bill C. | last post by:
Hi, I've got a simple console app that just reads an XML file into a DataSet then prints out a description of each table in the DataSet, including column names and row values for each column. ...
13
by: Adie | last post by:
Hi, is this not possible? public DataSet getDimensions() { } public SqlDataReader getDimensions() { }
15
by: JIM.H. | last post by:
Hello, Can I send a dataset as a parameter into stored procedure and import data to a table in the stored procedure? Thanks, Jim.
1
by: cindy | last post by:
Get data into datatable, add to dataset dsSearch " Get data into datatable, add to dataset dsSearch Using In-Memory SQL Engine join the tables and select the filenames from the join, add to...
5
by: Roy Lawson | last post by:
I am having no problems connecting to a DB, creating a DataAdapter, and creating a dataset...and connecting to the data. Using the builtin data objects to do all this. My only problem now is...
10
by: dauphian | last post by:
Hello, I am new to .net and am trying to build a report application that queries 4 different tables based on a id, and I need to return them in the same table for easy viewing. Basically, I...
3
by: Tom | last post by:
I have a dataTable being returned from my datalayet, I need to convert it to a dataSet so I can do some data manipulation to it prior to populating my datagrid. How can I convert the datatable to a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.