how to insert image into sql database table
-
how to insert the pic into the database table.. str_insert = "INSERT INTO SIS_TeachingStaff VALUES('TSMT2','V.RAJANIKANTH','LECTURER','TEACHING STAFF','Msc(Maths)','" & Emp_pic.Image & " '" '" & CByte(Me.opendialogbox.FileName.Length) & "' " cmd = New SqlCommand(str_insert, conn) cmd.Connection = conn cmd.ExecuteNonQuery() error is:operator '&' is not defined for types 'string' and 'system.drawing.image'
-
how to insert the pic into the database table.. str_insert = "INSERT INTO SIS_TeachingStaff VALUES('TSMT2','V.RAJANIKANTH','LECTURER','TEACHING STAFF','Msc(Maths)','" & Emp_pic.Image & " '" '" & CByte(Me.opendialogbox.FileName.Length) & "' " cmd = New SqlCommand(str_insert, conn) cmd.Connection = conn cmd.ExecuteNonQuery() error is:operator '&' is not defined for types 'string' and 'system.drawing.image'
-
how to insert the pic into the database table.. str_insert = "INSERT INTO SIS_TeachingStaff VALUES('TSMT2','V.RAJANIKANTH','LECTURER','TEACHING STAFF','Msc(Maths)','" & Emp_pic.Image & " '" '" & CByte(Me.opendialogbox.FileName.Length) & "' " cmd = New SqlCommand(str_insert, conn) cmd.Connection = conn cmd.ExecuteNonQuery() error is:operator '&' is not defined for types 'string' and 'system.drawing.image'
As pointed out, the error is because you are trying to concat a string and an image. What you need to do is convert the image into byte array and insert it into the database field. If you google for that, you should be OK.
Shreekar http://shreekarishere.blogspot.com
-
As pointed out, the error is because you are trying to concat a string and an image. What you need to do is convert the image into byte array and insert it into the database field. If you google for that, you should be OK.
Shreekar http://shreekarishere.blogspot.com