asp.net中怎样调用存储过程和存储过程的写法
----创建一个只有输入参数的存储过程
create procedure proc_user
@name varchar(20),
@Password varchar(100)
as
select * from loginuser
where name like @name
---创建一个有输入和输出参数的存储过程
create procedure proc_usertext
@name varchar(20),
@blog varchar(100) output
as
select @blog = blog from loginuser where name = @name
---创建一个有输入和返回参数的存储过程
create PROCEDURE returnval
@name varchar(100),
@blog varchar(100) output
AS
begin
select @blog = blog from loginuser where name = @name
if(@blog is null)
set @blog = ''你还没有申请博客''
return execute(@blog ) --数据数型的转换
end
在asp.net中的调用
protected void Page_Load(object sender, EventArgs e)
{
DataBind();
}
private void DataBind()
{
//只带输入参数的存储过程的写法。
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["strConnection"].ConnectionString);
SqlCommand cmd = new SqlCommand("proc_user", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@name", "l%");
cmd.Parameters.AddWithValue("@Password", "lcs9702");
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
DropDownList1.DataSource = dr;
DropDownList1.Data
相关文档:
摘要
在这篇文章中,Masoud讨论了应用ASP.NET中统一身份验证模型进行跨应用程序验证的问题,包括:Membership Providers, web.config配置,配置文件的加密解密等。在文章的最后,作者提供了通过ASP.NET login controls来验证的程序。
by Masoud Tabatabaei:
目录
简介
什么是SSO?它是怎样工作的?
系统条件 ......
本文所采用的FCKeditor版本是FCKeditor 2.6.4和FCKeditor.NET 2.6.3,都是当前FCKeditor的最新版本http://www.fckeditor.net上可以找到。
搞ASP.NET开发有一年时间了,做网站时常常用到在线HTML编辑器,一直用得是FCKeditor。FCKeditor在ASP.NET上的集成和配置,可以说搞得已经很清楚了。在网络上得到过很多前辈同仁们的帮 ......
81.什么是soap,有哪些应用。
答:simple object access protocal,简单对象接受协议.以xml为基本编码结构,建立在已有通信协议上(如http,不过据说ms在搞最底层的架构在tcp/ip上的soap)的一种规范web service使用的协议..
82.c#中 property 与 a ......
1. 访问 HTML控件的值是value属性
访问 ASP.NET控件的值是text属性
--------------------------------------------------------
2.分别需要的名字空间为:
using System.Web.UI.HTML.Controls;
using System.Web.UI.WebControls;
-------------------------------------------- ......