Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

Hi,

I have a ASP.Net 1.1 application with a Sql Server 2000 Database.

 

I have an orders table that contains the details of an order. There are orders from 2005 to till date.

I am displaying these orders in a Datagrid.

The user has the option to search the Orders table using many criteria (around 8 to 10) criterias.

 

I am uisng a DataTable as the DataSource for the Datagrid.

Below is the Code for the datasource

 

Private Sub BindData()

Dim dv As DataView

sqldataadpater1.Fill(DsOrdersList1)

dv = DsOrdersList1.Tables(0).DefaultView

If Not viewstate("SearchString") = "" Then

dv.RowFilter = viewstate("SearchString")

Else

dv.RowFilter = Nothing

End If

Datagrid1.DataSource = dv

Datagrid1.DataBind()

End Sub

I am using a SQL Server Stored Procedure as Command for the data adapter

 

Offcourse with the above technique , at the server end ALL the Orders table records are put into the Datable and then filtered based on the ROWFILTER.

 

With the increase in the Order Records , the search and display is getting SLOWER.

 

What other technique can I use to retrieve the records from the database , keeping in mind that I want to keep the option of filtering the records by the 8 to 10 criterias that I have.

 

The only way I can think of is using DYNAMIC SQL in the stored Procedure and send the Filter criteria to the stored Procedure. Offcourse this will result in a performance hit.

 

Are there any other ways ?

Edited by Rattlesnake
When you gotta go,you gotta go !!!!!!!

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...