Dim sqlstring = " begin tran;" sqlstring &= " INSERT INTO tbl_customers (stnname, cardnum, family_name, city, fam_mem_nu, id_num, mrkz_num) VALUES ('" & stn & "','" & cd & "', '" & fmnm & "','" & ct & "', '" & fnum & "', '" & idn & "', '" & cntr & "')" sqlstring &= "INSERT INTO tbl_customers(imag) SELECT * FROM OPENROWSET(BULK N'c:\temp\tempimg', SINGLE_BLOB) imag ; " sqlstring &= "commit tran;" sql.CommandText = sqlstring sql.Connection = conn conn.Open() Dim ms As New MemoryStream img = CameraControl1.SnapshotSourceImage img.Save("c:\temp\tempimg", Imaging.ImageFormat.Png) 'CameraControl1.SnapshotSourceImage.Save ' PictureBox3.Image.Save(ms, PictureBox3.Image.RawFormat) ' ms.ToArray() ' Dim data As Byte() = ms.GetBuffer() ' Dim p As New SqlClient.SqlParameter("@img", SqlDbType.VarBinary) ' p.Value = data ' sql.Parameters.Add(p) Dim x As Integer = sql.ExecuteNonQuery
if-else
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)