How to build an SQL-string from a record

D

DraguVaso

Hi,

I need a solution for this in SQL Server, or in VB.NET, so for this reason I
posted it to the 2 newsgroups.

I need to build an SQL String from a given record.
For exemple: I have in my table tblMyCows this record:
CowID: 1
CowName: Bella (a typical Belgian cowname)
CowGender: Female

I should have something that generates me the Insert-statement for it: like
this: "INSERT INTO tblMyCows (CowID, CowName, CowGender) VALUES (1, 'Bella',
'Female')".

If possible the same with an update an delete statement, and it would be
really nice if it could detect itself the primary keys, and use them for for
the update and Delete statements.

Anybody any idea?

Thanks a lot in advance,

Pieter
 
C

Cor Ligthert

Pieter,

Do you now need Bella because you was yesterday to much involved with
Stella.
I count 4 newsgroups, not 2.

However your problem sounds not difficult for me, what I not direct see, is
if the tblMycows is a datatable or that it is a table in a database?

Cor
 
C

Cor Ligthert

Pieter,
Hehe it was Jupiler :)

You don't believe it, that was what I wrote first.
However Bella and Stella did sound better.

:)

I have no sample at hand I will try to make it (I don't promish I succeed),
than probably I show it tomorrow. (I have the other way around).

Cor
 

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