Use a parameterized INSERT statement. Parameterized queries are
demonstrated here:
http://msdn2.microsoft.com/en-us/library/ms998271.aspx
about halfway down the page.
"TAC" wrote in message
>I am new to SQL Server 2005. I have a large database table, and I want to
>add new rows (records) to the table from within a C# program. The simplest
>method would seem to be using a T-SQL INSERT command, but T-SQL does not
>accept variables as input (only immediate values).
>
>
>
> I can also use an SQL DataAdapter and a DataSet, which I use to read
> subsets of data, but to add a new row to a large database would create an
> unnecessarily large in-memory cache of the data just to add a new row.
>
>
>
> What is the simplest way to add a new row to an SQL database table, from
> within a C# program, using variables as inputs to each of the column
> values?
>
>
>
> Thanks for any help.
>
>
>