Last post May 09, 2012 06:35 AM by Ravi Kumar Kurasala
May 07, 2012 09:40 AM|micahdavid2011|LINK
Split off from
http://forums.asp.net/t/1791798.aspx/5/10?connecting+and+selecting+a+data+from+the+database+through+one+text+field+in+visual+studio+2010. A new question deserves a new thread.
Thanks the code worked. But can you help me with a code that Will insert information into the database like names and address With a picture. And i want after uploading the picture it will Appear on the image map on the form. Can you help me on yhat?
May 09, 2012 06:35 AM|Ravi Kumar Kurasala|LINK
Code to insert information into database like names and address with a picture
Considering that the picture is being uploaded through the FileUpload WebControl, just convert it into binary and store into Database in image field.
The code is
bytdata = new
fileField.PostedFile.InputStream.Read(bytdata, 0, fileField.PostedFile.ContentLength);
Store the return value in a sqlcommand parameter and pass it to sqlcommand (containing insert to DB table) . The normal text like name and address can directly be assigned to parameter.