DROPDOWLIST PROBLEM

G

Guest

Hello to everyone,



I have web site ASP.NET 2.0

I have dedicated server for that site it is very fast calling from the
internal LAN

When we call from internet is fine except one page



In that page I have 8 DropDownList(s)

if I disable the code for populate DDlist the page is fine
we have same page from old web site ASP 3.0 and it if fine same code
What I do wrong????


Each dropdown list has 3500 rows



I think I optimize and call only one time Database…
I test and disable JavaScript is not that…
if I enable only one DDlist is acceptable but is slow


Here is my code



Public Sub buildStockStyleOptions()

Dim conn As New OracleConnection(dbConnection)



Dim query As String = "select TRIM(style) AS STYLE,TRIM(des) as
DESCRIPTION from (select style, FIRST_VALUE(description) OVER (partition by
style ORDER BY style ASC) AS DES from style) group by style,des "



Dim dt As DataTable = New DataTable("StockSTYLEs")

Try

conn.Open()

Dim adap As New OracleDataAdapter(query, conn)

adap.Fill(dt)

Catch ex As Exception

' make log entry for the error

cmpError.MakeLogEntry(ex, "error comes from function
buildStockStyleOptions PDRPageControlFromStock.ascx.vb")

Response.Redirect("?pg=DBError")

Finally

conn.Close()

End Try



Dim row As DataRow

row = dt.NewRow

row("DESCRIPTION") = ""

row("STYLE") = "(pick a style from this list)"

' dt.Rows.Add(row)

dt.Rows.InsertAt(row, 0)



ddStyleList1.DataSource = dt

ddStyleList1.DataValueField = "DESCRIPTION"

ddStyleList1.DataTextField = "STYLE"

ddStyleList1.DataBind()

ddStyleList1.Attributes.Add("onChange", "return check1();")

ddStyleList2.DataSource = dt

ddStyleList2.DataValueField = "DESCRIPTION"

ddStyleList2.DataTextField = "STYLE"

ddStyleList2.DataBind()

ddStyleList2.Attributes.Add("onChange", "return check2();")

ddStyleList3.DataSource = dt

ddStyleList3.DataValueField = "DESCRIPTION"

ddStyleList3.DataTextField = "STYLE"

ddStyleList3.DataBind()

ddStyleList3.Attributes.Add("onChange", "return check3();")

ddStyleList4.DataSource = dt

ddStyleList4.DataValueField = "DESCRIPTION"

ddStyleList4.DataTextField = "STYLE"

ddStyleList4.DataBind()

ddStyleList4.Attributes.Add("onChange", "return check4();")

ddStyleList5.DataSource = dt

ddStyleList5.DataValueField = "DESCRIPTION"

ddStyleList5.DataTextField = "STYLE"

ddStyleList5.DataBind()

ddStyleList5.Attributes.Add("onChange", "return check5();")

ddStyleList6.DataSource = dt

ddStyleList6.DataValueField = "DESCRIPTION"

ddStyleList6.DataTextField = "STYLE"

ddStyleList6.DataBind()

ddStyleList6.Attributes.Add("onChange", "return check6();")

ddStyleList7.DataSource = dt

ddStyleList7.DataValueField = "DESCRIPTION"

ddStyleList7.DataTextField = "STYLE"

ddStyleList7.DataBind()

ddStyleList7.Attributes.Add("onChange", "return check7();")

ddStyleList8.DataSource = dt

ddStyleList8.DataValueField = "DESCRIPTION"

ddStyleList8.DataTextField = "STYLE"

ddStyleList8.DataBind()

ddStyleList8.Attributes.Add("onChange", "return check8();")

dt.Dispose()

End Sub



Yes disable (ViewState + databind) cost less as size of the page 40%



But still is very, very slow



How in ASP same dropdownlist printed repeated 8 times takes 7 sec

In ASP used Session to store data for the DDlist





My dropdown when I databind is 187kb by 8 times I generate 1.756kb page L



This became the worst in my live



10x

val
 
G

Guest

Hello to everyone,

I have web site ASP.NET 2.0

I have dedicated server for that site it is very fast calling from the
internal LAN

When we call from internet is fine except one page

In that page I have 8 DropDownList(s)

if I disable the code for populate DDlist the page is fine
we have same page from old web site ASP 3.0 and it if fine same code
What I do wrong????

Each dropdown list has 3500 rows

I think I optimize and call only one time Database...
I test and disable JavaScript is not that...
if I enable only one DDlist is acceptable but is slow

Here is my code

Public Sub buildStockStyleOptions()

Dim conn As New OracleConnection(dbConnection)

Dim query As String = "select TRIM(style) AS STYLE,TRIM(des) as
DESCRIPTION from (select style, FIRST_VALUE(description) OVER (partition by
style ORDER BY style ASC) AS DES from style) group by style,des "

Dim dt As DataTable = New DataTable("StockSTYLEs")

Try

conn.Open()

Dim adap As New OracleDataAdapter(query, conn)

adap.Fill(dt)

Catch ex As Exception

' make log entry for the error

cmpError.MakeLogEntry(ex, "error comes from function
buildStockStyleOptions PDRPageControlFromStock.ascx.vb")

Response.Redirect("?pg=DBError")

Finally

conn.Close()

End Try

Dim row As DataRow

row = dt.NewRow

row("DESCRIPTION") = ""

row("STYLE") = "(pick a style from this list)"

' dt.Rows.Add(row)

dt.Rows.InsertAt(row, 0)

ddStyleList1.DataSource = dt

ddStyleList1.DataValueField = "DESCRIPTION"

ddStyleList1.DataTextField = "STYLE"

ddStyleList1.DataBind()

ddStyleList1.Attributes.Add("onChange", "return check1();")

ddStyleList2.DataSource = dt

ddStyleList2.DataValueField = "DESCRIPTION"

ddStyleList2.DataTextField = "STYLE"

ddStyleList2.DataBind()

ddStyleList2.Attributes.Add("onChange", "return check2();")

ddStyleList3.DataSource = dt

ddStyleList3.DataValueField = "DESCRIPTION"

ddStyleList3.DataTextField = "STYLE"

ddStyleList3.DataBind()

ddStyleList3.Attributes.Add("onChange", "return check3();")

ddStyleList4.DataSource = dt

ddStyleList4.DataValueField = "DESCRIPTION"

ddStyleList4.DataTextField = "STYLE"

ddStyleList4.DataBind()

ddStyleList4.Attributes.Add("onChange", "return check4();")

ddStyleList5.DataSource = dt

ddStyleList5.DataValueField = "DESCRIPTION"

ddStyleList5.DataTextField = "STYLE"

ddStyleList5.DataBind()

ddStyleList5.Attributes.Add("onChange", "return check5();")

ddStyleList6.DataSource = dt

ddStyleList6.DataValueField = "DESCRIPTION"

ddStyleList6.DataTextField = "STYLE"

ddStyleList6.DataBind()

ddStyleList6.Attributes.Add("onChange", "return check6();")

ddStyleList7.DataSource = dt

ddStyleList7.DataValueField = "DESCRIPTION"

ddStyleList7.DataTextField = "STYLE"

ddStyleList7.DataBind()

ddStyleList7.Attributes.Add("onChange", "return check7();")

ddStyleList8.DataSource = dt

ddStyleList8.DataValueField = "DESCRIPTION"

ddStyleList8.DataTextField = "STYLE"

ddStyleList8.DataBind()

ddStyleList8.Attributes.Add("onChange", "return check8();")

dt.Dispose()

End Sub

Yes disable (ViewState + databind) cost less as size of the page 40%

But still is very, very slow

How in ASP same dropdownlist printed repeated 8 times takes 7 sec

In ASP used Session to store data for the DDlist

My dropdown when I databind is 187kb by 8 times I generate 1.756kb page L

This became the worst in my live

10x

val

8 DropDownList X 3500 rows = are you kidding?

Anyway, it might be that the real problem is not in the DropDownList
Control. It might be a problem with OracleDataAdapter.Fill. Maybe you
can try to count the time it needs to execute that method.

Also try to use a native .NET provider from Oracle. You will need to
download and install it.
 
G

Guest

No the problem is : generate size of DDL is 178kb by 8 the page size is 1.7MB
it is crazy

I disable populate DDLists and is work fine

val
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top