如何在Oracle数据库的ASP.NET页面上进行大查询

时间:2022-01-14 04:10:19

I have an Oracle DB, and an ASP Page that has many ListBoxes and DropDownLists. These controls make the user input data to get filtered results on the next page.

我有一个Oracle DB,以及一个包含许多ListBoxes和DropDownLists的ASP页面。这些控件使用户输入数据在下一页上获得过滤结果。

Once the user clicks search, a string (query) is generated based on the selections of the user. The results page has a datagrid that takes this string and uses it to get data for the grid from the database.

用户单击搜索后,将根据用户的选择生成字符串(查询)。结果页面有一个datagrid,它接受此字符串并使用它从数据库中获取网格的数据。

Also, I want to use a separate class with methods to create the string.

另外,我想使用一个单独的类和方法来创建字符串。

My datagrid is working fine with queries that I type on my own, but what I need is a class to generate that query using all the user input.

我的datagrid可以正常处理我自己键入的查询,但我需要的是使用所有用户输入生成该查询的类。

What would be the best approach? (I am using ASP.NET 2.0 and C#)

什么是最好的方法? (我使用的是ASP.NET 2.0和C#)

2 个解决方案

#1


For such a broad question you're going to require multiple sets of information.

对于如此广泛的问题,您将需要多组信息。

You'll want to start by hooking into your Oracle database and making the query (Step 1). The next step is to display the results on your forms (Step 2). Once you've got that working, you can start parameterizing your queries (Step 3). Here is a collection of topics to get you started. You ought to be able to piece things together from there.

您将首先挂钩Oracle数据库并进行查询(步骤1)。下一步是在表单上显示结果(步骤2)。一旦你有了工作,你就可以开始参数化你的查询(步骤3)。以下是一系列主题,可帮助您入门。你应该能够从那里把东西拼凑起来。

Step 1 :: Conntecting to an Oracle DB in ASP.NET
Step 2 :: ASP.NET GridView Databinding
Step 3 :: Parameterized Queries

步骤1 ::在ASP.NET中连接到Oracle DB第2步:: ASP.NET GridView数据绑定第3步::参数化查询

#2


We've done similar things in that we have a massive Criteria page where the user can pick from ~400 points of data. Then we use all that data to formulate some kind of query into the database. We found it very useful to roll all that Criteria data into a serializable structure, we used a complex object that could serialize to xml. It made testing that whole system a thousand times easier. It also opened the door for us to add saved searches to the system.

我们做了类似的事情,因为我们有一个庞大的Criteria页面,用户可以从中搜索大约400个数据点。然后我们使用所有数据来形成对数据库的某种查询。我们发现将所有Criteria数据转换为可序列化结构非常有用,我们使用了一个可以序列化为xml的复杂对象。它使整个系统的测试变得容易了一千倍。它还为我们打开了向系统添加已保存搜索的大门。

Use a separate class for the Transform-Object-To-Sql code.

对Transform-Object-To-Sql代码使用单独的类。

#1


For such a broad question you're going to require multiple sets of information.

对于如此广泛的问题,您将需要多组信息。

You'll want to start by hooking into your Oracle database and making the query (Step 1). The next step is to display the results on your forms (Step 2). Once you've got that working, you can start parameterizing your queries (Step 3). Here is a collection of topics to get you started. You ought to be able to piece things together from there.

您将首先挂钩Oracle数据库并进行查询(步骤1)。下一步是在表单上显示结果(步骤2)。一旦你有了工作,你就可以开始参数化你的查询(步骤3)。以下是一系列主题,可帮助您入门。你应该能够从那里把东西拼凑起来。

Step 1 :: Conntecting to an Oracle DB in ASP.NET
Step 2 :: ASP.NET GridView Databinding
Step 3 :: Parameterized Queries

步骤1 ::在ASP.NET中连接到Oracle DB第2步:: ASP.NET GridView数据绑定第3步::参数化查询

#2


We've done similar things in that we have a massive Criteria page where the user can pick from ~400 points of data. Then we use all that data to formulate some kind of query into the database. We found it very useful to roll all that Criteria data into a serializable structure, we used a complex object that could serialize to xml. It made testing that whole system a thousand times easier. It also opened the door for us to add saved searches to the system.

我们做了类似的事情,因为我们有一个庞大的Criteria页面,用户可以从中搜索大约400个数据点。然后我们使用所有数据来形成对数据库的某种查询。我们发现将所有Criteria数据转换为可序列化结构非常有用,我们使用了一个可以序列化为xml的复杂对象。它使整个系统的测试变得容易了一千倍。它还为我们打开了向系统添加已保存搜索的大门。

Use a separate class for the Transform-Object-To-Sql code.

对Transform-Object-To-Sql代码使用单独的类。