473,395 Members | 1,977 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,395 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 1992
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...

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.