insert image in the database

Mr Creek

New Member
plz , can anyone help in this code ??\[code\]string imagename="test.png"; string imagepath=Server.MapPath("\\images"); SqlConnection con = new SqlConnection(); SqlConnectionStringBuilder S = new SqlConnectionStringBuilder("data source=hima-pc\\sql8;initial catalog=test; integrated security= True;pooling=false "); con.ConnectionString = S.ConnectionString; con.Open(); string sqlcon = "insert into images(imgname,imgpath)values("+imagename+","+imagepath+")"; SqlCommand myCom = new SqlCommand(sqlcon,con); int numrow = myCom.ExecuteNonQuery(); con.Close();\[/code\]plz i need to save the path of image in my database but without uploadfilemy image is already in the folder in server
 
Back
Top