如何将参数值传递给SqlStored过程从ASP.Net 4.0 Web窗体 [英] How do I pass parameter values to a SqlStored procedure From ASP.Net 4.0 Web Form

查看:61
本文介绍了如何将参数值传递给SqlStored过程从ASP.Net 4.0 Web窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ASP.net 4.0 网络表单上使用GridView控件,我正在尝试开发。我试图使用gridview控件的数据源控件将开始日期值和结束日期值传递给SQLServer存储过程。



希望,这将允许我使用存储过程返回的数据集加载gridview。 (它有多列数据,这就是我尝试使用gridview的原因。)



目标是:

1 。)显示Web表单

2.)用户然后选择开始日期和结束日期查看要查看的数据范围。

3.)用户点击一个按钮然后将所选日期作为参数传递给填充数据绑定gridview控件的存储过程。



我发现Microsoft帮助文件和演练令人困惑,并没有多大帮助。



如果我试图用手肘划伤我的耳朵,请告诉我。



如果您知道获取和显示数据的更简单方法,请告诉我。



如果您过去已经完成了这样的任务,我真诚地感谢你的回复。



CLW

I am using a GridView control on an ASP.net 4.0 web form, that I am trying to Develop. I am trying to use a datasource control with the gridview control to pass a "Start date" value and an "end date" value to a SQLServer stored procedure.

Hopefully, this will allow me to load the gridview with the data set returned by the Stored procedure. (It has multiple columns of data, which is why I am trying to use a gridview.)

The goal is to:
1.) display the Web form
2.) User then selects Start Date and End Date for range of data to be viewed.
3.) User Clicks a button which then passes the selected dates as parameters to the stored procedure filling the databound gridview control.

I find the Microsoft Help files and walkthroughs are confusing and not much help at all.

If I am trying to "scratch my ear with my elbow", please let me know.

If You know of an easier way to get and display the data, then please let me know.

If you have accomplished a task like this yourself in the past, I would sincerely appreciate a reply.

CLW

推荐答案

参考 - 按日期和两个文本框过滤网格视图? [ ^ ]。



您需要使用FilterExpression属性。
Refer - How filter a Gridview by daterange and two textbox?[^].

You need to use FilterExpression property.


这篇关于如何将参数值传递给SqlStored过程从ASP.Net 4.0 Web窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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