如何在asp.net的aspx.cs页面中使用存储过程使用select命令 [英] how to use select command using stored procedure in aspx.cs page in asp.net
本文介绍了如何在asp.net的aspx.cs页面中使用存储过程使用select命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在asp.net的aspx.cs页面中使用存储过程来使用选择命令?
我已经存储了procdure属性
现在我想使用带有select commond的存储过程将数据与aspx页面中的gridview绑定在一起.
请帮助我
thanx
how to use select command using stored procedure in aspx.cs page in asp.net???
i have stored procdure property
now i want to use that stored procedure with select commond to bind the data with gridview in aspx page........
plz help me
thanx
推荐答案
public DataSet GetDataset(SqlParameter param, string storedprocedurename)
{
SqlConnection sqlConn=new SqlConnection("Your connection string");
SqlCommand sqlCmd = new SqlCommand(storedprocedurename, sqlConn);
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.Parameters.Add(param);
sqlAdapter = new SqlDataAdapter(sqlCmd);
sqlAdapter.Fill(ds);
return ds;
}
希望对您有所帮助.
抱歉,如果我误解了您的问题.
Hope this may help you.
sorry if i misunderstood your question.
这篇关于如何在asp.net的aspx.cs页面中使用存储过程使用select命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文