如何调用窗口表单的过程? [英] How to call a procedure to a window form ?

查看:69
本文介绍了如何调用窗口表单的过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个窗口表单,现在我想用表格中的按钮调用我在数据库中的程序。

i have created a window Form , now i want to call the procedure i have in my database with the button in the form.

推荐答案

尝试类似:

Try something like:
using (SqlConnection con = new SqlConnection(strConnect))
    {
    con.Open();
    using (SqlCommand cmd = new SqlCommand("MyStoredProcedure", con))
        {
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.ExecuteNonQuery();
        }
    }


这篇关于如何调用窗口表单的过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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