我的存储过程是这样写的
create or replace PROCEDURE GETLOCATIONINRADIUS
(
RADIUS IN NUMBER,
CUR out sys_refcursor)
IS
BEGIN
OPEN CUR FOR
SELECT ID,"NAME", ADDRESS, CITY FROM TBLGEOGRAPHY
WHERE RI<RADIUS;
END;
然后我的VB.NET 程序是这样写的:
Dim conn As New OleDbConnection("Provider=SQLOLEDB;" & ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Dim command As OleDbCommand
command = New OleDbCommand("GETLOCATIONINRADIUS", conn)
command.Parameters.Add("LATI", OleDbType.Numeric).Value = latitude
command.Parameters.Add("LONGI", OleDbType.Numeric).Value = longitude
command.Parameters.Add("RADIUS", OleDbType.Numeric).Value = ddlRadius.SelectedValue
'command.Parameters.Add("CUR", OleDbType.Variant).Direction = ParameterDirection.Output
command.CommandType = CommandType.StoredProcedure
Dim da As New OleDbDataAdapter(command)
Dim ds As New DataSet()
好像OleDBType也没有针对CURSOR的类型 返回结果应该有多行 所以我用了cursor
VS2010 我在import的时候没有SYSTEM.DATA.OracleClient 这个选项 在Add Reference添加了以后还是失败 不知道怎么回事
我的WEB.CONFIG是
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=orcl;User ID=oracleTest;Password=oracleTest;Unicode=True"
providerName="System.Data.OracleClient" />
</connectionStrings>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
<membership>
<providers>
<clear/>
</providers>
</membership>
<profile>
<providers>
<clear/>
</providers>
</profile>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
希望好心人给我看看啊