Dynamic insert/update (ala EXEC SQL DESCRIBE)

  • Thread starter Thread starter Tim Nelson
  • Start date Start date
T

Tim Nelson

I am coming from a ESQL/C environment and I have the need to create
an application that builds an insert and an update statement dynamically
by querying a the schema for a database table.

With .Net it seems there are too many tools to work with. Basically, the
application takes 3 parameters:

1. A database connection string
2. A table name
3. An import file of pipe-delimited records

What I need to do is get a description of the table (and it's primary index)
and then dynamically create the insert and update. Consider:

create table foo (foo1 integer,foo2 varchar(20),primary key foo1)

I want to dynamically create:

insert into foo (foo1,foo2) values ( ?, ?)

and

update foo set foo2 = ? where foo1 = ?

Which System.Data classes should I be looking at to do this with the least
amount
of headache?
Thanks. Tim
 
Hello,

Tim Nelson said:
I am coming from a ESQL/C environment and I have the
need to create an application that builds an insert and an
update statement dynamically by querying a the schema
for a database table.

Notice that you will have a better chance to get an answer if you post this
question to the ADO.NET newsgroup:

news://msnews.microsoft.com/microsoft.public.dotnet.framework.adonet

Web interface:

http://msdn.microsoft.com/newsgroup...roup=microsoft.public.dotnet.framework.adonet
 
Back
Top