Replies |
Add this in the webconfig between the System.web
<httpRuntime maxRequestLength="500000"/> Thank you for posting at Dotnetfunda
[Administrator]
Ganeshsvelu, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|
Now its working fine but after i stored the values in sql server 2008 table.It takes more time to store then it shows this error
"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding".
Ganeshsvelu, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|
if you use ado.net set your command object timeout to 0 that means infinite , it will not timeout.
Thank you for posting at Dotnetfunda
[Administrator]
Ganeshsvelu, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|
It shows this error.
Incorrect syntax near ')'.
Ganeshsvelu, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|
I Use this command.
string strCon = _connectionString;//cms.Connection.ConnectionString;
SqlConnection objCon = new SqlConnection(strCon);
objCon.Open();
SqlCommand objCom = new SqlCommand(sqlText, objCon);
objCom.ExecuteNonQuery();
objCon.Close();
Ganeshsvelu, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|
Ganeshsvelu always put your code in code tags, look at the Forum guidelines. Another thing dont open the connection while you still initializing the objects. your code should look like this
string strCon = _connectionString;//cms.Connection.ConnectionString;
SqlConnection objCon = new SqlConnection(strCon);
SqlCommand objCom = new SqlCommand(sqlText, objCon);
objCom.CommandTimeout = 0;
try
{
objCon.Open();
objCom.ExecuteNonQuery();
}
catch(sqlException ex)
{
//print the ex.Message here
}
finally
{
objCon.Close();
}
look at the Bolded part its the timeout set to infinite Thank you for posting at Dotnetfunda
[Administrator]
Ganeshsvelu, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|