Sam,
Assuming you don't want to write a code-gen product, I would do the
following (this assumes you are using SQL Server).
Start by creating a typed data set, which will create the
insert/update/delete/select statements for the table.
Create a test program to insert one record into the table with the typed
data set.
Run SQL Server profiler on the database in SQL Server (filter by your
machine as the client) and make sure you get the batch statement begin, and
the statement begin events. You also want the statement text in the trace.
Run your program. You will see something like "sp_execute" along with a
parameterized statement (your insert, update, or delete statement) along
with a list of parameters and types.
From this statement, you should be able to generate your stored
procedure easily on the database. It will require a bunch of copy and
pasting, but it's better than having to do the field and type discovery by
hand.
Once you have your stored procedure, you can just drag it into VS.NET
and it will create a wrapper for you to call it by, or you can use the Data
Access Application Block to make the call for you, where it generates all
the SqlParameter instances for you, and sets them up correctly.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Sam Shrefler" <ss*******@gmail.comwrote in message
news:11**********************@r3g2000prh.googlegro ups.com...
>I have a database table that contains approx 150 columns per row. I
need to update all 150 columns at once. To create a stored procedure
will cause me to have to create 150 sqlParameters....Rows will only be
updated one at a time. Does anyone else have any thoughts on the best
way to handle this. The data is available to .NET in the form of a
typed transfer object with 150 data elements in it.
Thanks