I am working on a visual C# program for image processing.I am trying to add image to sql database using Visual C# (Windows forms) and ADO.NET.
I have converted the i
Try with something like this:
byte[] fileBytes=System.IO.File.ReadAllBytes("path to file");
System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("insert into table(blob,filename) values (@blob,@name)");
command.Parameters.AddWithValue("blob", fileBytes);
command.Parameters.AddWithValue("name", "filename");
command.ExecuteNonQuery();