georgepatotk Posted May 3, 2004 Posted May 3, 2004 I have a Server with 1Mbps Line, And I have a client with 384kbps Line. Now, I am using DataBinding concept for adding and editing data on the sql server. I found out that the speed is very slow. I am thinking of using SQL query for performing all these tasks. Before I start, I would like to know whether SQL query approach will speed up the precess? If can, how many percent it can be increased. Or anyone can suggest me with any approach which can help in speed up the process. Thanks in advance. Quote George C.K. Low
georgepatotk Posted May 3, 2004 Author Posted May 3, 2004 daStockCode.SelectCommand.CommandText = "SELECT * FROM tblStock" dsStockCode.Clear() daStockCode.Fill(dsStockCode) The above code shows that I retrieve the data from the server everytime this procedure is called. Let's say this procedure is Textbox_TextChanged everytime the value is changed, the data is been refresh. Consume a lot of resources. I am thinking whether there is a way, where we could store all the data in a dataset and we keep retrieve from the dataset without refering to the server. Quote George C.K. Low
Moderators Robby Posted May 3, 2004 Moderators Posted May 3, 2004 "I am thinking whether there is a way, where we could store all the data in a dataset and we keep retrieve from the dataset without refering to the server."That's exactly how you should do it, you can have a class member dataset that you keep within the scope of your form. It looks like your dsStockCode is already a member of your page, right? Quote Visit...Bassic Software
JABE Posted May 3, 2004 Posted May 3, 2004 Filling up a dataset on an event such as TextChanged is a disaster. If you really need to re-query the db, do it in a less interactive event such as the click of a button. Otherwise, you can just filter the dataset in-memory, w/o hitting the server. Also, you can use stored procedures to speed up your queries. Quote
georgepatotk Posted May 4, 2004 Author Posted May 4, 2004 That's exactly how you should do it, you can have a class member dataset that you keep within the scope of your form. It looks like your dsStockCode is already a member of your page, right? True, dsStockCode is added into my Project. Now, I want to do it in such way. When I open the application, the dsStockCode filled. Now, I want to search for Stock with StockCode = "ABCD" What should I do instead of daStockCode.SelectCommand.CommandText = _ "SELECT * FROM tblStock WHEER StockCode = 'ABCD'" dsStockCode.Clear() daStockCode.Fill(dsStockCode) Quote George C.K. Low
Moderators Robby Posted May 4, 2004 Moderators Posted May 4, 2004 Use RowFilter of the Dataview of the Dataset...."StockCode = 'ABCD'" Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.