.net调用存储过程问题
我使用了以下代码
SqlConnection mycon=new SqlConnection(con);
mycon.Open();
SqlCommand mycom=new SqlCommand("classno",mycon);
mycom.CommandType=CommandType.StoredProcedure;
mycom.Parameters.Add("@classnom",SqlDbType.VarChar);
string novalue = TextBox1.Text.Trim();
mycom.Parameters["@classnom"].Value = novalue;
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = mycom;
DataSet ds = new DataSet();
da.Fill(ds,"bjb");
GridView1.DataSource=ds;
GridView1.DataBind();
mycon.Close();
存储过程如下,但是查不出结果
CREATE procedure classno
@classnom varchar
as
select * from bjb where 班级号=@classnom
GO
请各位指教,谢谢了
SqlConnection mycon=new SqlConnection(con);
mycon.Open();
SqlCommand mycom=new SqlCommand("classno",mycon);
mycom.CommandType=CommandType.StoredProcedure;
mycom.Parameters.Add("@classnom",SqlDbType.VarChar);
string novalue = TextBox1.Text.Trim();
mycom.Parameters["@classnom"].Value = novalue;
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = mycom;
DataSet ds = new DataSet();
da.Fill(ds,"bjb");
GridView1.DataSource=ds;
GridView1.DataBind();
mycon.Close();
存储过程如下,但是查不出结果
CREATE procedure classno
@classnom varchar
as
select * from bjb where 班级号=@classnom
GO
请各位指教,谢谢了
...全文
相关推荐
.net调用存储过程详细介绍
本文的数据库用的是sql server自带数据Northwind
在.NET中调用Oracle存储过程经验总结[定义].pdf
在.NET中调用Oracle存储过程经验总结[定义].pdf
在.NET中调用Oracle存储过程经验总结.doc
在.NET中调用Oracle存储过程经验总结 连接Oracle参考文档
查找过程中调用的存储过程
有时,在我们拥有大型数据库的情况下,很难找到存储过程中对不同存储过程的所有调用并生成报告。 该工具旨在编写所有SP的脚本,并提取使用其他信息(例如作者姓名和描述)进行的SP调用。
VB.NET调用MySQL存储过程并获得返回值的方法
本文实例讲述了VB.NET调用MySQL存储过程并获得返回值的方法。分享给大家供大家参考。具体实现方法如下: Dim myConnectionString As String = Database= & myDatabase & _ ;Data Source= & myHost & _ ;User Id= & myUserId & ;Password= & myPassword Dim myConnection As New MySqlConnection(myConnectionString) Try myConnection.Open() Catch M


