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

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 1988
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
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
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
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
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
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
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
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
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
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
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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)...
0
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.