Home > Archive > ASP .NET > March 2007 > DROPDOWLIST PROBLEM
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
DROPDOWLIST PROBLEM
|
|
| bluelabs 2007-03-29, 7:09 pm |
| 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
| |
| Alexey Smirnov 2007-03-29, 7:09 pm |
| On Mar 29, 5:22 pm, bluelabs <bluel...@discussions.microsoft.com>
wrote:
> 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.
| |
| bluelabs 2007-03-29, 10:05 pm |
| 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
|
|
|
|
|