Click here to Skip to main content
15,886,075 members
Home / Discussions / Database
   

Database

 
AnswerRe: Sql Server Windows Authentication Mode in Workgroup Environment? Pin
Pete O'Hanlon15-Oct-07 5:09
mvePete O'Hanlon15-Oct-07 5:09 
GeneralRe: Sql Server Windows Authentication Mode in Workgroup Environment? Pin
DotNetWWW15-Oct-07 6:33
DotNetWWW15-Oct-07 6:33 
GeneralRe: Sql Server Windows Authentication Mode in Workgroup Environment? Pin
Laxman Auti16-Oct-07 23:31
Laxman Auti16-Oct-07 23:31 
GeneralRe: Sql Server Windows Authentication Mode in Workgroup Environment? Pin
DotNetWWW17-Oct-07 2:44
DotNetWWW17-Oct-07 2:44 
Questionadd new user to sql server database 2005 Pin
Gazide15-Oct-07 3:50
Gazide15-Oct-07 3:50 
AnswerRe: add new user to sql server database 2005 Pin
Giorgi Dalakishvili15-Oct-07 4:02
mentorGiorgi Dalakishvili15-Oct-07 4:02 
GeneralRe: add new user to sql server database 2005 Pin
Hesham Amin16-Oct-07 3:49
Hesham Amin16-Oct-07 3:49 
QuestionTimeout problem Pin
gratisaccount15-Oct-07 3:46
gratisaccount15-Oct-07 3:46 
Hi All,

I have wrote stored procedure which calculates points for result for around 1000 users.

This procedure takes no parameters from asp.net code.

asp.net code is used for just for calling this procedure. But when I run this procedure from the code it gives me the timout error.

while running from the sql server itself it works fine.

Kindly tell me how can I overcome this problem?

Below is my code, which is giving me the error.

try

{

Helper connHLP = new Helper(false);
connHLP.Retrieve("prcUpdateUsePoints", null);


}catch (Exception ex)
{

throw ex;

}

----------------------------------------------------------------------------------------------------------------------

Code for connection & retrive:

private SqlConnection conn;
private SqlTransaction tran;

public Helper(bool TransactionRequired)
{

try

{

string strConn = string.Empty;
strConn = System.Configuration.ConfigurationManager.AppSettings["ConnectionString"].ToString();

conn = new SqlConnection(strConn);
conn.Open();

if (TransactionRequired == true)
{

tran = conn.BeginTransaction();

}

else

{

tran = null;
}

}

catch (Exception ex)
{

throw ex;
}

}

public DataSet Retrieve(string ProcedureName, SqlParameter[] ParamCollection)
{

try

{

DataSet ds = new DataSet();SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;

if (ParamCollection != null)
SetParameters(cmd, ParamCollection);

cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = ProcedureName;

SqlDataAdapter adp = new SqlDataAdapter(cmd);
adp.Fill(ds);

return ds;
}

catch (Exception ex)
{

throw ex;
}

finally

{

conn.Close();

}

}



public void SetParameters(SqlCommand cmd, SqlParameter[] ParamCollection)
{

try

{

foreach (SqlParameter param in ParamCollection)
cmd.Parameters.Add(param);

}

catch (Exception ex)
{

throw ex;
}

}

----------------------------------------------------------------------------------------------------------------------


Thnking you all in advance.

AnswerRe: Timeout problem Pin
kubben15-Oct-07 3:54
kubben15-Oct-07 3:54 
AnswerRe: Timeout problem Pin
Mike Dimmick15-Oct-07 3:56
Mike Dimmick15-Oct-07 3:56 
AnswerRe: Timeout problem Pin
gratisaccount15-Oct-07 18:51
gratisaccount15-Oct-07 18:51 
GeneralRe: Timeout problem Pin
kubben16-Oct-07 2:48
kubben16-Oct-07 2:48 
QuestionProblem with ISNULL Pin
braj yadav15-Oct-07 2:02
braj yadav15-Oct-07 2:02 
AnswerRe: Problem with ISNULL Pin
kubben15-Oct-07 2:45
kubben15-Oct-07 2:45 
AnswerRe: Problem with ISNULL Pin
Frank Kerrigan15-Oct-07 3:07
Frank Kerrigan15-Oct-07 3:07 
AnswerRe: Problem with ISNULL Pin
Michael Potter15-Oct-07 5:44
Michael Potter15-Oct-07 5:44 
Questionexception Pin
Trustapple15-Oct-07 0:32
Trustapple15-Oct-07 0:32 
AnswerRe: exception Pin
Andy_L_J15-Oct-07 2:54
Andy_L_J15-Oct-07 2:54 
AnswerRe: exception Pin
Mike Dimmick15-Oct-07 4:02
Mike Dimmick15-Oct-07 4:02 
QuestionJOINS Pin
karoitay14-Oct-07 23:53
karoitay14-Oct-07 23:53 
AnswerRe: JOINS Pin
John-ph14-Oct-07 23:56
John-ph14-Oct-07 23:56 
Generalthanks Pin
karoitay15-Oct-07 0:26
karoitay15-Oct-07 0:26 
QuestionHow do I pass DB name as parameter to stored procedure? Pin
Steven J Jowett14-Oct-07 22:22
Steven J Jowett14-Oct-07 22:22 
AnswerRe: How do I pass DB name as parameter to stored procedure? Pin
Marek Grzenkowicz14-Oct-07 23:43
Marek Grzenkowicz14-Oct-07 23:43 
GeneralRe: How do I pass DB name as parameter to stored procedure? Pin
Steven J Jowett14-Oct-07 23:54
Steven J Jowett14-Oct-07 23:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.