【发布时间】:2017-03-22 07:07:16
【问题描述】:
如何在 C# 上运行 GO 查询。以下是我的查询
sqlConnection.Open();
cmd.CommandText = ("USE Repository" +
"GO" +
"DECLARE @return_value int," +
"@o_error_code int," +
"@o_error_msg varchar(2000)" +
"EXEC @return_value = [dbo].[XCENTER_CUST_CREATE_UPDATE]" +
"@i_input_xml = N'<xml code>'," +
"@i_transaction_id = N'100A'," +
"@o_error_code = @o_error_code OUTPUT," +
"@o_error_msg = @o_error_msg OUTPUT" +
"SELECT @o_error_code as N'@o_error_code'," +
"@o_error_msg as N'@o_error_msg'" +
"SELECT 'Return Value' = @return_value" +
"GO");
cmd.CommandType = CommandType.Text;
cmd.Connection = sqlConnection;
reader = cmd.ExecuteReader();
dt.Load(reader);
DT1.DataSource = dt;
这是在我按下按钮后运行,xml代码的值在文本框中
【问题讨论】:
标签: c#