SQLCommand Parameters

  • Thread starter Thread starter jkhome
  • Start date Start date
J

jkhome

Please could someone help me. I'm looking to do a dynamic insert
statement. How should i go about this in dot net. Should i be using
parameters if so would someone beable to explain these to me. I cannont
find much on the internet explaining them.

I did read somewhere that they will format the data ready to input into
the db is this correct ie add additional quotes etc. I just need
someone to explain to me how they work.
 
Please could someone help me. I'm looking to do a dynamic insert
statement. How should i go about this in dot net. Should i be using
parameters if so would someone beable to explain these to me. I cannont
find much on the internet explaining them.

I did read somewhere that they will format the data ready to input into
the db is this correct ie add additional quotes etc. I just need
someone to explain to me how they work.

Command parameters are a feature of the database engine. The database can
accept queries with the arguments hard-coded, like

select * from customers where name = 'Smith'

or it can accept parameterized queries with a seperate parameter value. The
client sends

select * from customers where name = @pName

and also sends

Smith

The database client library will take care of formatting, so no single
quotes are required, and server knows how to put that together, and can
reuse the compiled query plan for any subsequent name search.

David
 
Back
Top