hello sir i want solve this, i have to upload excel data to server database while doing this it displays this error
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding
i have found th solution to assign command timeout but i am using sqlbulkcopy how to solve
DataTable dtExcel = new DataTable();
string path = string.Concat(Server.MapPath("~/file/" + FileUpload1.FileName));
FileUpload1.SaveAs(path);
string excelConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 12.0;Persist Security Info=False";
OleDbConnection excelConnection = new OleDbConnection(excelConnectionString);
OleDbCommand cmd = new OleDbCommand("Select * from [1st year ANM Result 2014$]", excelConnection);
excelConnection.Open();
OleDbDataReader dReader;
dReader = cmd.ExecuteReader();
SqlBulkCopy sqlBulk = new SqlBulkCopy(con);
sqlBulk.DestinationTableName = "ANM_RESULT_1st_year";
sqlBulk.WriteToServer(dReader);
excelConnection.Close();
}