Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

George C.K. Low

Posted

        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.

George C.K. Low

  • Moderators
Posted
"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?
Visit...Bassic Software
Posted
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.
Posted
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)

George C.K. Low

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...