From: Frank Uray on
Hi all

For example: I have a DataSet with two tables
and one relation between each other.

Is there a direct way to publish this tables
to the SQL Server even when the tables
dont exists ?
I know, using SqlDataAdapter, it is possible
to update/insert/delete data. But for
this, the table has to exists ...

Thanks for any help !

Best regards
Frank Uray
From: Uri Dimant on
Frank
What do you mean by publish? Can you explain a little bit what are you
trying to achive?


"Frank Uray" <FrankUray(a)discussions.microsoft.com> wrote in message
news:81A072D5-7277-472A-AF63-44EE0F4CDDE4(a)microsoft.com...
> Hi all
>
> For example: I have a DataSet with two tables
> and one relation between each other.
>
> Is there a direct way to publish this tables
> to the SQL Server even when the tables
> dont exists ?
> I know, using SqlDataAdapter, it is possible
> to update/insert/delete data. But for
> this, the table has to exists ...
>
> Thanks for any help !
>
> Best regards
> Frank Uray


From: Frank Uray on
Hi Uri

Well, I have a C# DataTable or a DataSet with several tables.
Now I would like to have this table(s) in SQL Server in the
most easy way.
The idea is to have something like a SqlDataAdapter bound
to a DataTable and than create this table in the SQL Server ...

Thanks and best regards
Frank Uray

"Uri Dimant" wrote:

> Frank
> What do you mean by publish? Can you explain a little bit what are you
> trying to achive?
>
>
> "Frank Uray" <FrankUray(a)discussions.microsoft.com> wrote in message
> news:81A072D5-7277-472A-AF63-44EE0F4CDDE4(a)microsoft.com...
> > Hi all
> >
> > For example: I have a DataSet with two tables
> > and one relation between each other.
> >
> > Is there a direct way to publish this tables
> > to the SQL Server even when the tables
> > dont exists ?
> > I know, using SqlDataAdapter, it is possible
> > to update/insert/delete data. But for
> > this, the table has to exists ...
> >
> > Thanks for any help !
> >
> > Best regards
> > Frank Uray
>
>
> .
>
From: Philipp Post on
Frank,

> Now I would like to have this table(s) in SQL Server in the
most easy way. <

I fear there is no generic solution for this as the DataSet /
DataTable does not carry all necessary information for this, e. g. how
do you transform STRING? Should it become CHAR, NCHAR, VARCHAR,
NVARCHAR, TEXT, NTEXT....? What about the needed keys?

I guess you would have to brew your own converter or better first have
a look at how the DataSet / DataTable is created in your C#
application. Possibly you could incorporate building a CREATE TABLE
statement there.

brgds

Philipp Post