如何从C#Winform中的表适配器获取输出参数的值 [英] How to get a value of output parameter from Table Adapter in C# Winform

查看:86
本文介绍了如何从C#Winform中的表适配器获取输出参数的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello World

我有C#Winform应用程序用于SQL数据库的workig。

在SQL数据库中,我有SELECT,INSERT,UPDATE,DELETE作业的存储过程。

My DataSet配置为使用这些过程。

INSERT的存储过程有一个OUTPUT参数(保存的新记录的ID)。

我想将该参数的值赋给某个​​变量(例如:int x = ...)

我不知道如何从TableAdapter获取OUTPUT参数的值。

非常感谢''阅读我的文本

Hello World
I have C# Winform application for workig with SQL datadase.
In SQL database I have stored procedures for SELECT, INSERT, UPDATE, DELETE jobs.
My DataSet is configured to use those procedures.
Stored procedure for INSERT has one OUTPUT parameter ( ID of saved new record ).
I would like to assign a value of that parameter to some variable ( say: int x = ...)
I don''t know how can I get the value of OUTPUT parameter from TableAdapter.
Many thank'' for reading my text

推荐答案

看看这里: HOW TO:使用ADO调用参数化存储过程.NET和Visual C#.NET [ ^ ]。

你会找到一个解决方案;)
Have a look here: HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET[^].
There you''ll find a solution ;)


这篇关于如何从C#Winform中的表适配器获取输出参数的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆