如何在C#Windows应用程序中从SQL Server 2005调用视图 [英] how to call a view from sql server 2005 in c# windows application

查看:73
本文介绍了如何在C#Windows应用程序中从SQL Server 2005调用视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SqlCommand cmd = new SqlCommand("exec ExitMvntView '" + txtRemnQty.Text + "'", con);
cmd.Parameters.AddWithValue("@remain", txtRemnQty.Text);
con.Close();
con.Open();
cmd.ExecuteNonQuery();
frmmovement_Load(sender, e);

推荐答案

您不能直接从前端调用Sql View.您应该为此使用一个过程.在存储过程中执行视图,并从前端调用该存储过程.

--Amit
You cannot call a Sql View directly from front-end. You should use a procedure for that. Execute your view inside your stored procedure and call that stored procedure from front-end.

--Amit


这篇关于如何在C#Windows应用程序中从SQL Server 2005调用视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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