Typed Dataset Hijinks

J

Jerry

I have a typed dataset with a table schema which includes columns from
multiple sources. I have the final schema structure defined in the typed
dataset. I use a temporary table filled from a select statement and then
add the additional columns to the temporary table. At this point the
temporary table should match the typed table schema.
I was trying to find the most efficient way to fill the typed table with the
records from the temporary table. My original thought was to find a way to
simply lay the schema over the temporary table.
Is this somehow possible?

Regards
 
J

Jerry

Miha,
I will check that option, however it is my understanding that in datasets
the schema is separate from the actual data. I should be able to simply set
the new tables schema to be equal to the table defined in the typed dataset
and begin accesssing it as a typed table in the dataset. The question is
how to do that.

Regards

Miha Markic said:
Hi Jerry,

If you have primary key defined you might use Merge method.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Jerry said:
I have a typed dataset with a table schema which includes columns from
multiple sources. I have the final schema structure defined in the typed
dataset. I use a temporary table filled from a select statement and then
add the additional columns to the temporary table. At this point the
temporary table should match the typed table schema.
I was trying to find the most efficient way to fill the typed table with the
records from the temporary table. My original thought was to find a way to
simply lay the schema over the temporary table.
Is this somehow possible?

Regards
 
G

Guest

The real goal should be to get the data directly into the
typed dataset table without it's pitstop in the temp
table. You can actually add fields to a result set by
specifying them in your select statement. That way you can
format your data in the original select statement well
enough to make it fit the schema. You can say:
SELECT "" As MyNewField ...
to create a new field
if you need to change the name of a field to make it fit
you can say
SELECT [Field] AS [Newname]
Either way you should be able to create a SELECT statement
which will fill your typed dataset table directly when you
fire off the DataAdapter.
 

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