在.NET中调用存储过程
2007-06-27 13:31
246 查看
1.用SqlCommand和DataSet:
SqlConnection conn=new SqlConnection("server=(local);uid=;password=;database=");
SqlCommand cmd=new SqlCommand("StoreProcedure",connn);
cmd.CommandType=CommandType.StoreProcedure;
SqlDataAdapter dsCommand=new SqlDataAdapter(cmd);
DataSet ds=new DataSet();
dsCommand.Fill(ds);
2.用SqlCommand和SqlDataAdapter
Sqlconnection conn=new SqlConnection("server=(local);uid=;password=;database=");
SqlCommand cmd=new SqlCommand("StoreProcedure",conn);
cmd.CommandType=CommandType.StoreProcedure;
SqlDataReader dr=cmd.ExecuteReader()
while(dr.Read())
{
Response.Write(dr.Item["Field"]);
}
SqlConnection conn=new SqlConnection("server=(local);uid=;password=;database=");
SqlCommand cmd=new SqlCommand("StoreProcedure",connn);
cmd.CommandType=CommandType.StoreProcedure;
SqlDataAdapter dsCommand=new SqlDataAdapter(cmd);
DataSet ds=new DataSet();
dsCommand.Fill(ds);
2.用SqlCommand和SqlDataAdapter
Sqlconnection conn=new SqlConnection("server=(local);uid=;password=;database=");
SqlCommand cmd=new SqlCommand("StoreProcedure",conn);
cmd.CommandType=CommandType.StoreProcedure;
SqlDataReader dr=cmd.ExecuteReader()
while(dr.Read())
{
Response.Write(dr.Item["Field"]);
}
相关文章推荐
- 步步为营VS 2008 + .NET 3.5(10) - DLINQ(LINQ to SQL)之调用存储过程的添加、查询、更新和删除
- .NET中统一的存储过程调用方法(收藏)
- 在.NET中调用Oracle9i存储过程经验总结
- .NET中统一的存储过程调用方法(收藏)
- .net 调用Oracle存储过程
- .net调用存储过程详细介绍
- 在.net中如何把调用存储过程代码写入数据连接层中
- 在.NET中调用Oracle9i存储过程经验总结
- 在.NET中调用Oracle9i存储过程经验总结
- .NET中统一的存储过程调用方法
- 步步为营VS 2008 + .NET 3.5(10) - DLINQ(LINQ to SQL)之调用存储过程的添加、查询、更新和删除
- 在.NET中调用Oracle9i存储过程经验总结------------转载
- 在.NET中调用Oracle9i存储过程经验总结
- 在.NET中调用Oracle9i存储过程经验总结
- .net,调用sql存储过程
- 我转载的文章《.NET中统一的存储过程调用方法 》具体实现代码
- .NET中统一的存储过程调用方法(收藏)
- 在.NET中调用Oracle9i存储过程经验总结
- ORACLE通用分页存储过程及.NET调用方式
- 10、步步为营VS 2008 + .NET 3.5(10) - DLINQ(LINQ to SQL)之调用存储过程的添加、查询、更新和删除