473,473 Members | 1,793 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DataSet copy

Hi, is there any way to copy a dataset to a datagrid? I have a
dataset and want to copy to a datagridview, but I get no results....
thx!

Nov 1 '07 #1
4 2276
Soulless,
you cannot "copy" a DataSet to a DataGrid. DataGrid only knows how to do
DataBinding against the DataSource.
So, you set DataSource property of the DataGrid to DataSet, or to one of the
DataTables in the DataSet.
-- Peter
// Abandon all hope, ye who enter here.
http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Soulless" wrote:
Hi, is there any way to copy a dataset to a datagrid? I have a
dataset and want to copy to a datagridview, but I get no results....
thx!

Nov 1 '07 #2
On Nov 1, 3:22 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.NoSpamMaam.comwrote:
Soulless,
you cannot "copy" a DataSet to a DataGrid. DataGrid only knows how to do
DataBinding against the DataSource.
So, you set DataSource property of the DataGrid to DataSet, or to one of the
DataTables in the DataSet.
-- Peter
// Abandon all hope, ye who enter here.http://www.eggheadcafe.com
unBlog:http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Soulless" wrote:
Hi, is there any way to copy a dataset to a datagrid? I have a
dataset and want to copy to a datagridview, but I get no results....
thx!- Hide quoted text -

- Show quoted text -
I created a dataset and set my datasource of the grid to it.

I am getting the following error now:

Error 12 Cannot implicitly convert type 'System.Data.DataTable' to
'OpTx.Extract.DataSet.Impac.dsUpdateSQL' C:\develop\extract\Forms\Impac
\FormScheduleNotes.cs 720 28 Forms

The line of code is:

dsUpdateSQL1 = ibrScheduleNotes.dsSched.Tables["Schedule"].Copy();

dsUpdateSQL1 is my dataset.

Any ideas?
Nov 1 '07 #3
On Nov 1, 3:22 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.NoSpamMaam.comwrote:
Soulless,
you cannot "copy" a DataSet to a DataGrid. DataGrid only knows how to do
DataBinding against the DataSource.
So, you set DataSource property of the DataGrid to DataSet, or to one of the
DataTables in the DataSet.
-- Peter
// Abandon all hope, ye who enter here.http://www.eggheadcafe.com
unBlog:http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Soulless" wrote:
Hi, is there any way to copy a dataset to a datagrid? I have a
dataset and want to copy to a datagridview, but I get no results....
thx!- Hide quoted text -

- Show quoted text -
Hi,

I have created a dataset and have set my datasource on the grid to the
dataset.

I get the following error:

Error 12 Cannot implicitly convert type 'System.Data.DataTable' to
'OpTx.Extract.DataSet.Impac.dsUpdateSQL' C:\develop\extract\Forms\Impac
\FormScheduleNotes.cs 720 28 Forms

The syntax is:

dsUpdateSQL1 = ibrScheduleNotes.dsSched.Tables["Schedule"].Copy();

dsUpdateSQL1 is my dataset and the ibrScheduleNotes.dsSched is a
dataset from another class.

Nov 1 '07 #4

Hi,
Wouldn't the copy have to be table to table?
The ouput of copy is a datatable not a dataset.
dsUpdateSQL1.Tables["mySchedule"] =
ibrScheduleNotes.dsSched.Tables["Schedule"].Copy();
I haven't tried this just seems logical.
hth
Bob
On 1 Nov 2007 15:48:25 -0700, Soulless <dg*******@gmail.comwrote:
>On Nov 1, 3:22 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.NoSpamMaam.comwrote:
>Soulless,
you cannot "copy" a DataSet to a DataGrid. DataGrid only knows how to do
DataBinding against the DataSource.
So, you set DataSource property of the DataGrid to DataSet, or to one of the
DataTables in the DataSet.
-- Peter
// Abandon all hope, ye who enter here.http://www.eggheadcafe.com
unBlog:http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Soulless" wrote:
Hi, is there any way to copy a dataset to a datagrid? I have a
dataset and want to copy to a datagridview, but I get no results....
thx!- Hide quoted text -

- Show quoted text -

Hi,

I have created a dataset and have set my datasource on the grid to the
dataset.

I get the following error:

Error 12 Cannot implicitly convert type 'System.Data.DataTable' to
'OpTx.Extract.DataSet.Impac.dsUpdateSQL' C:\develop\extract\Forms\Impac
\FormScheduleNotes.cs 720 28 Forms

The syntax is:

dsUpdateSQL1 = ibrScheduleNotes.dsSched.Tables["Schedule"].Copy();

dsUpdateSQL1 is my dataset and the ibrScheduleNotes.dsSched is a
dataset from another class.
Nov 3 '07 #5

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

Similar topics

5
by: Mike | last post by:
I need to expand the DataSet class by inheriting from it and adding functions that work on the data in the tables. However, since I can't upcast how can I get my base DataSet object assigned an...
10
by: localhost | last post by:
I have a static, thread-safe class with a DataSet as a property. When the class is instanced into an object, some callers add rows to a DataTable in the DataSet. Other callers read the DataSet. ...
1
by: Jeroen Pot | last post by:
Hi, I have a dataset "Mydataset" which contains of a few fields. (lets say dept_id and dept_name) A user can select several of these, and i want to export this to an access database. I have...
3
by: Dmitry Karneev | last post by:
Hi! I have a rather interesting problem. I have a dataset that contatin data from database. I need to clone this dataset with data but all id's in tables must be NULL and all DataRowStates must...
3
by: JJ | last post by:
Hi, I need to pass a dataset to another win form along with a SqldataAdapter. I don't want to recreate the SqlDataAdapter again either. So to pass to another Win form in my windows form app, do...
6
by: Vik | last post by:
A dataset is saved in session state. Then the dataset is filled out with the new records using a dataadapter. It appears then that the dataset saved in session state contains the new records even...
2
by: David Richards | last post by:
Hi, I was wondering if anyone could help me. I have DataSet that contains the following data tables Customers, Calls, Quotes, QuoteDetails, Competitors, Contacts, Notes, and I have setup...
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...
5
by: Franck | last post by:
how come unchanged always true even if data changed This code come from my saving button: ============================================ DataSet ds1 = new DataSet(); DataSet ds2 = new...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...
0
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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.