View Single Post
  #4 (permalink)  
Old September 11th, 2006, 07:30 AM
SriRamaKrishna SriRamaKrishna is offline
Authorized User
 
Join Date: Sep 2006
Location: , , India.
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi ,
  U cant use quotations in variables which is included in query forming statement.It always gives problem.
Better try to give values as parameters.
eg.
  string sql = "insert into (col1,col1) values (@parameter1 ,@parameter1)
   sqlcommand cmd = new sqlcommand(sql,con);
cmd.parameters.add(@parameter1,value)
cmd.parameters.add(@parameter2,value)

now excecute and try