Hi there,
I am developing a winform application[with c#] with SQL Database [attached].
All process with SQL query are OK, but at the first time when application open and user Login for application; SQL query takes too much time [may application is HANG or STOP working (say for 5-6 seconds) and then after successfully login application start.
After it; all SQL process will executes well.
If user close application and start over again ... it's again slow / Hang/ Not working starts....
I can't getting wht is matter with this...?
Can you tell me what is mistake in my query?
Jignesh TrivediPosted Oct 15, 2014, 1:17 AM
Hi,
I donot know what exact problem you are facing.
by considering some point you can improve startup performance.
like
Reduce code in Form Load
use lazy loading (load the data when required.
always Call Dispose()
Pre-compile your assemblies using NGEN when appropriate to decrease start-up time
Remove all references from your project that are not used
hope this will help you.
Nilesh DalviPosted Oct 14, 2014, 1:33 PM
it takes 6 sec to load my Home Page.
Abt how many entries in my Login table... its only 3 user in table and its only having name,username & password column.
Name------Username--------Password
Nilesh------Nilesh123--------Nil123
Sharad-----Sharad123-------Shar123
Sushant----Sush123---------Sus123
[thats it....]
Abt sql idexes ; i'm not shame to tell that I never used Index before...
Is it really work for me; then plz tell me hw to use SQL Index for login page.
Wim SturkenboomPosted Oct 14, 2014, 11:23 AM
You can add some timing checks to see what takes long. Opening the connection or executing the query or reading the result or ...
DateTime dtStart = DateTime.Now;
con.open();
DateTime dtEnd = DateTime.Now;
...
...
com.ExecuteNonQuery();
DateTime dtEnd = DateTime.Now;
...
...
etc
Put breakpoints at sensible places and check the durations of the steps.
How many records do you have in the table UserDetails? If there are a lot of them, is your table correctly indexed?
Note: your query is prone to SQL injection; read up on parameter queries.
Nilesh DalviPosted Oct 14, 2014, 8:23 AM
con.Open();
Munesh SharmaPosted Oct 14, 2014, 12:27 AM
Vithal WadjePosted Oct 13, 2014, 1:57 PM