Here's what should probably be a a simple DataSet question

I have queried a dataset from databaseA and now I want to insert its
contents into databaseB. If I do a DataAdapter.Update(), it only stores rows
added since it was queried from databaseA - which is understandable as it
thinks that they're up to date in the database (but that was a diferent
database!).

So, how can I tell the DataSet that its rows are out of date and all need
inserting? I thought I might set DataRow.RowState, but that's a get only
property.

Any help appreciated. The only idea I've had so far is to copy all the rows
to another DataSet.

TIA

Tim

Re: DataSet question by Tomas

Tomas
Fri Sep 02 09:25:47 CDT 2005

Hi,

unfortunately this is exactly what you will have to do - import rows to a
new dataset.

The thing you need will be supported in VS.NET 2005, where you will be able
to change state of your records, so you will be able to re-insert them.

Regards


Tomas

"Tim Haynes" <TimHaynes@discussions.microsoft.com> pí¹e v diskusním
pøíspìvku news:938FF968-3B7F-4167-9F91-47E3CF521027@microsoft.com...
> Here's what should probably be a a simple DataSet question
>
> I have queried a dataset from databaseA and now I want to insert its
> contents into databaseB. If I do a DataAdapter.Update(), it only stores
> rows
> added since it was queried from databaseA - which is understandable as it
> thinks that they're up to date in the database (but that was a diferent
> database!).
>
> So, how can I tell the DataSet that its rows are out of date and all need
> inserting? I thought I might set DataRow.RowState, but that's a get only
> property.
>
> Any help appreciated. The only idea I've had so far is to copy all the
> rows
> to another DataSet.
>
> TIA
>
> Tim



Re: DataSet question by Cor

Cor
Fri Sep 02 09:41:50 CDT 2005

Tim,

For that is a nice property in the dataadapter.
You just have to know it

:-)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatarowclassgetparentrowstopic.asp

And on the otherside you need of course the schema, for what is as well a
nice method that you only have to know.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatacommondataadapterclassfillschematopic.asp

I hope this helps,

Cor



Re: DataSet question by TimHaynes

TimHaynes
Fri Sep 02 11:27:03 CDT 2005

Hi,

I took a quick look at msdn2.microsoft.net and didn't see anything that
leapt out at me. Any idea where the state change property/method is?

Thanks,

Tim


"Tomas Vavrda" wrote:

> Hi,
>
> unfortunately this is exactly what you will have to do - import rows to a
> new dataset.
>
> The thing you need will be supported in VS.NET 2005, where you will be able
> to change state of your records, so you will be able to re-insert them.
>
> Regards
>
>
> Tomas
>
> "Tim Haynes" <TimHaynes@discussions.microsoft.com> pí¹e v diskusním
> pøíspìvku news:938FF968-3B7F-4167-9F91-47E3CF521027@microsoft.com...
> > Here's what should probably be a a simple DataSet question
> >
> > I have queried a dataset from databaseA and now I want to insert its
> > contents into databaseB. If I do a DataAdapter.Update(), it only stores
> > rows
> > added since it was queried from databaseA - which is understandable as it
> > thinks that they're up to date in the database (but that was a diferent
> > database!).
> >
> > So, how can I tell the DataSet that its rows are out of date and all need
> > inserting? I thought I might set DataRow.RowState, but that's a get only
> > property.
> >
> > Any help appreciated. The only idea I've had so far is to copy all the
> > rows
> > to another DataSet.
> >
> > TIA
> >
> > Tim
>
>
>

Re: DataSet question by TimHaynes

TimHaynes
Fri Sep 02 11:29:03 CDT 2005

Followed the link and couldn't see where the ParentRows properety comes in.
Am I missing something here?

Thanks,

Tim

"Cor Ligthert [MVP]" wrote:

> Tim,
>
> For that is a nice property in the dataadapter.
> You just have to know it
>
> :-)
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatarowclassgetparentrowstopic.asp
>
> And on the otherside you need of course the schema, for what is as well a
> nice method that you only have to know.
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatacommondataadapterclassfillschematopic.asp
>
> I hope this helps,
>
> Cor
>
>
>

Re: DataSet question by Tomas

Tomas
Fri Sep 02 11:45:34 CDT 2005

Here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadonet/html/datasetenhance.asp

(The article is very long, so this is the excerpt)

To that end, ADO.NET 2.0 introduces two new methods on the DataRow class:
SetAdded and SetModified. Before you ask about setting the state to Deleted,
or Unchanged, let me remind you that with version 1.x we already have the
Delete and AcceptChanges/RejectChanges methods to accomplish this.

Tomas


"Tim Haynes" <TimHaynes@discussions.microsoft.com> pí¹e v diskusním
pøíspìvku news:BE85E922-E035-4945-8077-A7B6ED952F33@microsoft.com...
> Hi,
>
> I took a quick look at msdn2.microsoft.net and didn't see anything that
> leapt out at me. Any idea where the state change property/method is?
>
> Thanks,
>
> Tim
>
>
> "Tomas Vavrda" wrote:
>
>> Hi,
>>
>> unfortunately this is exactly what you will have to do - import rows to a
>> new dataset.
>>
>> The thing you need will be supported in VS.NET 2005, where you will be
>> able
>> to change state of your records, so you will be able to re-insert them.
>>
>> Regards
>>
>>
>> Tomas
>>
>> "Tim Haynes" <TimHaynes@discussions.microsoft.com> pí1e v diskusním
>> poíspivku news:938FF968-3B7F-4167-9F91-47E3CF521027@microsoft.com...
>> > Here's what should probably be a a simple DataSet question
>> >
>> > I have queried a dataset from databaseA and now I want to insert its
>> > contents into databaseB. If I do a DataAdapter.Update(), it only
>> > stores
>> > rows
>> > added since it was queried from databaseA - which is understandable as
>> > it
>> > thinks that they're up to date in the database (but that was a diferent
>> > database!).
>> >
>> > So, how can I tell the DataSet that its rows are out of date and all
>> > need
>> > inserting? I thought I might set DataRow.RowState, but that's a get
>> > only
>> > property.
>> >
>> > Any help appreciated. The only idea I've had so far is to copy all the
>> > rows
>> > to another DataSet.
>> >
>> > TIA
>> >
>> > Tim
>>
>>
>>



Re: DataSet question by Cor

Cor
Fri Sep 02 12:07:11 CDT 2005

Tim,

You surely do, that was an old link in my clipboard.

This is the right one

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatacommondataadapterclassacceptchangesduringfilltopic.asp

I hope this helps better.

Cor

"Tim Haynes" <TimHaynes@discussions.microsoft.com> schreef in bericht
news:AF6504C9-D339-41F2-B187-1E09BFAD4309@microsoft.com...
> Followed the link and couldn't see where the ParentRows properety comes
> in.
> Am I missing something here?
>
> Thanks,
>
> Tim
>
> "Cor Ligthert [MVP]" wrote:
>
>> Tim,
>>
>> For that is a nice property in the dataadapter.
>> You just have to know it
>>
>> :-)
>>
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatarowclassgetparentrowstopic.asp
>>
>> And on the otherside you need of course the schema, for what is as well a
>> nice method that you only have to know.
>>
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatacommondataadapterclassfillschematopic.asp
>>
>> I hope this helps,
>>
>> Cor
>>
>>
>>