我怎么能从结构分类的计算中得到结果?
有两个案件”
CASE 1
RETURN "Process ok"
CASE 2
RETURN "Process failed"
This will be returned from the stored procedure.
怎样才能在www.net、C#(Windows Forms)上阅读?
我怎么能从结构分类的计算中得到结果?
有两个案件”
CASE 1
RETURN "Process ok"
CASE 2
RETURN "Process failed"
This will be returned from the stored procedure.
怎样才能在www.net、C#(Windows Forms)上阅读?
如果您认为可以取得多个记录或<代码>,请您使用<代码>DataReader。 缩略语 如果你只获得单一价值,没有记录,没有多个栏目,只是一个插头或暗中......
在这里,如何使用储存程序,然后让读者阅读第1栏:
using(var conn = new OracleConnection("Data Source=oracledb;User Id=UserID;Password=Password;"))
{
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "storedProcedurename";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(...);
conn.Open();
OracleDataReader dr = cmd.ExecuteReader();
while(dr.Read())
{
var yourResult = dr[0].ToString();
}
}
这取决于你是否正在援引所储存的程序,或者如果你试图收回记录。
关于所储存的程序,它可以将数值分配到<代码>>out <>>>或inout
参数或生成一个记录。 前者需要使用command.CommandType至。
典型的问题是:
using (var cmd = connection.CreateCommand())
{
cmd.CommandText = "SELECT something FROM YourTable";
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
{
Console.WriteLine(reader["something"]);
}
}
}
关于数据库链接,我确实建议你使用
As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...
I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...
I have two EF entities. One has a property called HouseNumber. The other has two properties, one called StartHouseNumber and one called EndHouseNumber. I want to create a many to many association ...
I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....
I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...
I ve got some code which sets up a datacontext. Often enough, the datacontext should be set to some underlying data collection, such as an ObservableCollection - but occasionally I d like to set it ...
I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...
NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...