Iam trying to save the uploaded image into database and also into folder in my project.Problem is that not able to save image into folder
error:The process cannot access the file because it is being used by another process
protected void RadGrid_Insert(object sender, GridCommandEventArgs e)
{
GridEditFormInsertItem InsertItem = e.Item as GridEditFormInsertItem;
try
{
string Name = (InsertItem.FindControl("txbName") as TextBox).Text;
string Address = (InsertItem.FindControl("txtAddress") as TextBox).Text;
string ContactPerson = (InsertItem.FindControl("txtContactPerson") as TextBox).Text;
int PhoneNumber = int.Parse((InsertItem.FindControl("txtPhoneNumber") as TextBox).Text);
string EmailID = (InsertItem.FindControl("txtEmail") as TextBox).Text;
RadAsyncUpload radAsyncUpload = InsertItem.FindControl("AsyncUpload1") as RadAsyncUpload;
UploadedFile file = radAsyncUpload.UploadedFiles[0];
string s = file.FileName;
string path = "images/";
byte[] fileData = new byte[file.InputStream.Length];
file.InputStream.Read(fileData, 0, (
int)file.InputStream.Length);
UploadedFile file1 = radAsyncUpload.UploadedFiles[0];
file1.SaveAs(Server.MapPath(path+s));