Use the value of a variable for DB connection


hello everyone!

how value of variable oledb connection? use value of variable 'where num = variable'. this. guys .

hi,

try http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbcommand.parameters.aspx best way pass parameters sql command (my understanding have variable in code , want use value in sql command).

for discussion benefits of approach see http://www.codinghorror.com/blog/2005/04/give-me-parameterized-sql-or-give-me-death.html

with approach give data using native datatype (date, string, decimal numbers or whatever) , passing them server side under suitable form done you.

else you'll have format each , every value correctly depending on type (for example ' needs doubled strings etc...) yourself...


please mark whatever response solved issue thread marked "answered".



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'