databased filled dropdown slow or crash

C

catweezle2010

Hello,

I fill a dropdown with data from sql server with vbscript. In the view
on the sql server are just citynames, only one row. To fill the
dropdown takes round about 4 seconds. That's not nice, but if it only
happens on page load, I can live with it. The realy bad thing is the
posback. Either it takes 20 seconds and more, if I do a databind() on
the dropdown, or the hole page crash.

I tested it with dataset and datareader. Both work in the same way.

It have to be possible to fill a dropdwon with a lot of data in a
rather fast way and no problems in with postback (holidaypages can do
this too).

Can some one help me, please.
 
M

Mr Newbie

You say you are filling it from the SQL Server using VBSCRIPT ?, Are you
really doing this from the client ?

You should be binding to a DataSet serverside and then saving this to cache
which will be so much faster once the initial page has loaded and really
should not be too slow on load either.


Mr N
 
C

catweezle2010

Hello Mr N,

my mistake. It's not vbscript on clientsite. I just wanted to say I use
vb and not c#.

I do it onpageload. And it is slowly. But on Postback it's the horror.
I think, the postback deliver all the data back to the server, don't
know what he is doing with it, but something. And these two steps need
a long time. I think so, because I have a datagrid, in which I drop
data from a select. And because of a mistake in sqlstring I got all
data and the postback needs rather long too.

So the problem is still there - saving to cache, on client site? Do you
have a link or example-code?
 
M

Mr Newbie

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

If Not Page.IsPostBack Then

Me.adaptCalls.Fill(Me.DsCalls1)
Me.adaptContacts.Fill(Me.DsContacts1)
Me.adaptContactTypes.Fill(Me.DsContactTypes1)

AddToCache("adaptCalls", adaptCalls)
AddToCache("adaptContacts", adaptContacts)
AddToCache("adaptContactTypes", adaptContactTypes)

AddToCache("dsCalls", DsCalls1)
AddToCache("dsContacts", DsContacts1)
AddToCache("dsContactTypes", DsContactTypes1)


End If


End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top