I'm giving an example to store an image in database.Use this
suppose an insert function
insertfunction(byte[] buffer);
to insert a pic.
int l=uploadPhoto.PostedFile.ContentLength;
byte[] pic= new byte[l];
uploadPhoto.PostedFile.InputStream.Read(pic,0,l);
string typ = uploadPhoto.PostedFile.ContentType;
insertfunction(pic);
any doubt plz ask