You must Sign In to post a response.

System.IO.IOException: The device is not ready


This error come to this register page.Insert into DefaultImage in

register page,so come to this problem,online only.this code is working fine to


[Error:System.IO.IOException: The device is not ready]

[ FileStream fs = new FileStream("D:\\new vimmmiv\\images\\no_photo_large.jpg", FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
byte[] photo = br.ReadBytes((int)fs.Length);

strConnection = ConfigurationManager.ConnectionStrings["Matrimony"].ToString();
con = new SqlConnection(strConnection);
Trans = con.BeginTransaction();
com9 = new SqlCommand("sp_image", con);
com9.CommandType = CommandType.StoredProcedure;
com9.Parameters.Add("@Reg", SqlDbType.Decimal).Value = r;
com9.Parameters.Add("@Image", SqlDbType.Image).Value = photo;
com9.Parameters.Add("@ImageType", SqlDbType.Char).Value = t;
com9.Parameters.Add("@LockCode", SqlDbType.VarChar).Value = l;
com9.Parameters.Add("@Createdon", SqlDbType.DateTime).Value = DateTime.Now;
com9.Parameters.Add("@Modifiedon", SqlDbType.DateTime).Value = DateTime.Now;
com9.Parameters.Add("@Flag", SqlDbType.Char).Value = s;
//com9.Parameters.Add("@ImageType", SqlDbType.Char).Value = t;
com9.Transaction = Trans;

Thank You,


Author: Karthik K11 Nov 2009 Member Level: Silver   Points : 2

For uploading images to a folder, you need to give access rights like read, write permission to that folder.Check with your system admin persons or webhosting.

Sign In to post your comments