Showing posts with label stmt. Show all posts
Showing posts with label stmt. Show all posts

Sunday, February 26, 2012

error comming at insert stmt

assume connection is established and photo cloumn as data type as image in sql table.

str_insert ="INSERT INTO SIS_TeachingStaff VALUES('TSMT2','V.RAJANIKANTH','LECTURER','TEACHING STAFF','Msc(Maths)','" & Emp_pic.Image &"' "

cmd =New SqlCommand(str_insert, conn)

cmd.Connection = conn

cmd.ExecuteNonQuery()

Error at insert stmt: Operator '&' is not defined for types 'string' and 'system.drawing.image'

Hi

")" is missed at the end .Try this:

str_insert ="INSERT INTO SIS_TeachingStaff VALUES('TSMT2','V.RAJANIKANTH','LECTURER','TEACHING STAFF','Msc(Maths)','" & Emp_pic.Image &"') "