using Asp.net with c# and sql
i have two upload controls in asp.net form and one textbox .. i have submit button .. if click button the two uploaded image files and textbox values should store in a table in SQL..
id
file upload 1
file upload2
button
Any one Know this.. Help me if possible
Loading
Rekha SinghPosted Jan 5, 2010, 2:33 AM
byte[] imageData = ReadFile(FileUploader.FileName);
//use the web.config to store the connection string
SqlConnection connection = new SqlConnection("connection string")
SqlCommand command = new SqlCommand("INSERT INTO tablename (Picture) VALUES (@img_data) ", connection);
SqlParameter param1 = new SqlParameter("@img_data", SqlDbType.Image);
param1.Value = imageData;
command.Parameters.Add(param1);
connection.Open();
command.ExecuteNonQuery();
connection.Close();
*****************************
pls mark it accepted if u find it helpful