DataSets Continued

S

Soulless

Hi,

I'm still having some troubles. I decided maybe i can copy or assign
a datatable to another datatable or grid and remove the uncessary
columns, but I get an error... example:

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.


Is there anyway to cast the datatable to a dataset or should I do this
a different way? I'm having no luck with this.

Thanks!
 
I

Ignacio Machin \( .NET/ C# MVP \)

Copy() returns a DataTable, not a Dataset, you can do it like this:


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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top