Prashant
unread,Mar 25, 2008, 10:38:16 AM3/25/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hi,
I am using following code to fill my dataset. when multiple user
connect to the web-site it will give me following error:
Error Message: Transaction (Process ID 98) was deadlocked on lock
resources with another process and has been chosen as the deadlock
victim. Rerun the transaction.
I am using stored procedure to select records from database.
DataSet ds = new DataSet();
SqlConnection mc = OpenSqlConnection();
try
{
SqlCommand cmd = new SqlCommand(strCmd, mc);
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandTimeout = 0;
if (parameters != null)
{
foreach (KeyValuePair<string, object> p in parameters)
{
cmd.Parameters.AddWithValue(p.Key, p.Value);
}
}
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds);
}
catch (Exception ex)
{
}
finally
{
mc.Close();
}
return ds;
Appreciate your help,
prashant