473,507 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dataset casting (merge)

How can I cast the dataset

I generated the dataset from schema and named it 'Staff'. I use this dataset (staff dataset) as a datasource in the report

then I would like to generate the data from Staff dataset, here is the logic

Dim ds as DataSe
Dim ds2 as DataSet

ds = sqlhelper.ExecuteDataSet (....) //Get data from store proces, this line is o
msgbox(ds.tables(0).rows.count) //return x row

ds2 = new Staff //compiled

ds2.Merge (ds) //compiled but return not row
msgbox (ds2.tables(0).rows.count) //return

How can I get the ds2 returning the same rows as ds? Can anyone help?
Nov 22 '05 #1
6 1997
Ignore my above questions. I already found out what's wrong. The datatype of the dataset returned by sql server is not the same with dataset created by the schema.
Nov 22 '05 #2
Ignore my above questions. I already found out what's wrong. The datatype of the dataset returned by sql server is not the same with dataset created by the schema.
Nov 22 '05 #3
Cor
Hi Bernard,

For the merge in the same tables, they need to have the same schema.

If you want exactly the same dataset you can use the dataset.copy

If you want to have a part you can use a dataset.clone and than add the rows
by using the dataview, a table.select or a find.

However you cannot add a datarow which is already attached to one dataset
attach to another, but trasporting the data creating newdatarows in the new
tables and filling that with either the itemarray or the items is no
problem.

(In other words you have to use a for loop if it is not the complete
dataset)

Cor
Nov 22 '05 #4
Cor
Hi Bernard,

For the merge in the same tables, they need to have the same schema.

If you want exactly the same dataset you can use the dataset.copy

If you want to have a part you can use a dataset.clone and than add the rows
by using the dataview, a table.select or a find.

However you cannot add a datarow which is already attached to one dataset
attach to another, but trasporting the data creating newdatarows in the new
tables and filling that with either the itemarray or the items is no
problem.

(In other words you have to use a for loop if it is not the complete
dataset)

Cor
Nov 22 '05 #5
AA
> For the merge in the same tables, they need to have the same schema

This isn't exactly true. You can specify whether to add missing schema or not
(In other words you have to use a for loop if it is not the complet
dataset


Can't you merge datarow array also
----- Cor wrote: ----

Hi Bernard

For the merge in the same tables, they need to have the same schema

If you want exactly the same dataset you can use the dataset.cop

If you want to have a part you can use a dataset.clone and than add the row
by using the dataview, a table.select or a find

However you cannot add a datarow which is already attached to one datase
attach to another, but trasporting the data creating newdatarows in the ne
tables and filling that with either the itemarray or the items is n
problem

(In other words you have to use a for loop if it is not the complet
dataset

Co

Nov 22 '05 #6
AA
> For the merge in the same tables, they need to have the same schema

This isn't exactly true. You can specify whether to add missing schema or not
(In other words you have to use a for loop if it is not the complet
dataset


Can't you merge datarow array also
----- Cor wrote: ----

Hi Bernard

For the merge in the same tables, they need to have the same schema

If you want exactly the same dataset you can use the dataset.cop

If you want to have a part you can use a dataset.clone and than add the row
by using the dataview, a table.select or a find

However you cannot add a datarow which is already attached to one datase
attach to another, but trasporting the data creating newdatarows in the ne
tables and filling that with either the itemarray or the items is n
problem

(In other words you have to use a for loop if it is not the complet
dataset

Co

Nov 22 '05 #7

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

Similar topics

8
749
by: Bruce Stockwell | last post by:
the setup: Webservice/WinClient application/SQL server. VS.Net (visual basic) winform wizard creates a simple form with load cancel cancelall and datagrid bound to a simple Dataset with one...
3
342
by: Bernard | last post by:
How can I cast the dataset I generated the dataset from schema and named it 'Staff'. I use this dataset (staff dataset) as a datasource in the report then I would like to generate the data from...
3
1643
by: Li Weng | last post by:
Hi, I have an original dataset. It is copied to 2 different forms. Each form adds a new row to the same table in that dataset. When I merge these 2 dataset back to original one, the 2 new rows...
2
2094
by: muntyanu | last post by:
Hi all, I have problem when merging existing DataTable into new dataset. DataSet ds = new DataSet(); while ( done ) { // fill myCustomDataSet.MyTable with data ds.Merge(...
1
9334
by: Optimus | last post by:
Hi everyone, I currently develop an application in vs.net 2005 with vb.net. I was trying to use typed dataset and I've got in trouble for converting untyped dataset into Typed DataSet. I don't...
4
2222
by: Al | last post by:
I have this scenario: 1. XML file with schema and data is created from SQL Server tables. XML file contains 6 tables, some of them have rows, some of them are empty. 2. XML file is given to the...
1
2508
by: matt | last post by:
hello, i have a web app that allows users to query our oracle db and produce a dataset of report data. they then have the option to serialize this data and store it in the database. later, then...
5
16698
by: Mark Chambers | last post by:
Hi there, Can anyone explain the following (very) simple scenario. 1) I make an exact copy of my "DataSet" and delete one record from a given table (in the copy) 2) I invoke...
2
1846
by: Neil Chambers | last post by:
I am trying to get my head around dataset merging but despite a little research I could still use a pointer (or ten). Basically I want to perform an outer join operation on a dataset (created from...
1
6130
by: joproulx | last post by:
Hello all, Here is my problem: I am trying to merge 2 datasets but I don't want to overwrite rows that are already modified in my working dataset. Example: I have one Dataset with only one...
0
7110
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
7314
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
7372
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
5623
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,...
1
5041
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1540
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 ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
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...

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.