Click here to Skip to main content
15,893,266 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear Frnds,

I have developed one web application(asp.net c#). i used sql server database. when i click save,update,delete,retrieve button browser is processing after some seconds only action performed. how to quick access. pls help me..




thanks & Regards,
Vivek .R
Posted

1 solution

We can't answer that based on that information.
We have no idea how your code is written, how it works, anything really.

So start by getting some information on timings: Use the Stopwatch class to monitor how long it takes to actually do things like access the database and log the results to a file. Try to work out where the bottleneck is: is it in the connection to SQL? Or in the code you are using to send the info to SQL afterwards? Or does the DB stuff take trivial amounts of time and the communications between your browser and your webhost take forever?

When you have timing information you have two things:
1) A set of values against which to compare the results of any changes so you know what improved things, and by how much.
2) Hopefully, some idea of where the improvements are needed, and where it is pointless to try.

But without even that, everyone is whistling in the dark!
 
Share this answer
 
Comments
Vivek.anand34 13-Nov-14 4:22am    
I used code like this:
try
{
SqlCommand cmd = new SqlCommand();
conn.Open();
string qur;
qur = "insert into EmpDetails (EmpId,EmpName,Contact) values('" + txtEmpId.Text + "','" + txtEmpName.Text + "','" + txtContact.Text + "')";
cmd = new SqlCommand(qur, conn);
cmd.ExecuteNonQuery();
MessageBox.Show("Saved Sucessfully");
conn.Close();
FillDataGrid();
}
catch(Exception ex)
{
MessageBox.Show("ERROR:"+ex);
}
OriginalGriff 13-Nov-14 4:31am    
:sigh:
What do you think MessageBox does in website applications?
Where do you think it is displayed?
C# code is executed at the Server, not the Client. So the MessageBox will be displayed at the Server, not the Client. So, the user won't see it to click on the "OK" button, so it will sit there until the web hosting service decides it isn't going to get a response, and kills the task.

It worked on your development system because the client and the server were the same computer...
Vivek.anand34 13-Nov-14 4:51am    
sorry. this is for example coding.. like this code we are done in web application.
OriginalGriff 13-Nov-14 5:10am    
Where is the point of showing me code that doesn't actually look like the code you have a problem with?

That's like you taking my car to the garage because your car is broken and you want them to fix it!
Vivek.anand34 13-Nov-14 6:48am    
I used code like this:
try
{
SqlCommand cmd = new SqlCommand();
conn.Open();
string qur;
qur = "insert into EmpDetails (EmpId,EmpName,Contact) values('" + txtEmpId.Text + "','" + txtEmpName.Text + "','" + txtContact.Text + "')";
cmd = new SqlCommand(qur, conn);
cmd.ExecuteNonQuery();
MessageBox.Show("Saved Sucessfully");
conn.Close();
FillDataGrid();
}
catch(Exception ex)
{
MessageBox.Show("ERROR:"+ex);
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900