怎样绑定用户级别的存储过程到下拉菜单上? 单位需要从数据库中去读用户级别的存储过程,那么各位大侠,这个SQL怎么写啊? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 参考一下这个贴子的提问方式http://topic.csdn.net/u/20091130/20/8343ee6a-417c-4c2d-9415-fa46604a00cf.html 1. 你的 create table xxx .. 语句 2. 你的 insert into xxx ... 语句 3. 结果是什么样,(并给以简单的算法描述) 4. 你用的数据库名称和版本(经常有人在MS SQL server版问 MySQL) select name from sysobjects where type='p'? 没那么复杂。我在数据库上新建了几个存储过程,现在我想要把这几个我建立的存储过程绑定到COMBOBOX上。怎么写啊?各位大虾! private void Form1_Load(object sender, System.EventArgs e){//在formload时绑定数据表yg到comboBox1SqlConnection conn=new SqlConnection("server=.;uid=sa;pwd=;database=gz");conn.Open();SqlDataAdapter da=new SqlDataAdapter("select * from sys.objects where type='P' and name not like 'sp_%'",conn);DataSet ds=new DataSet();da.Fill(ds,"yg");DataRow dr = ds.Tables["yg"].NewRow();dr["ygid"] = "0";dr["ygname"] = "-请选择-";ds.Tables["yg"].Rows.InsertAt(dr, 0);this.comboBox1.DataSource=ds.Tables["yg"];this.comboBox1.DisplayMember="ygname"; //显示的列this.comboBox1.ValueMember="ygid"; //数据列,次列会在selectedvalue中显示conn.Close();} 我刚试了试,存储过程可是是汉字的。那我想可以是汉字的就最好了,不用写说明文件了,那么中文的存储过程绑定SQL怎么写?谢谢 sql except用法 50分求ADOConnection连接到MSDE的字符串代码[局域网中] sql2000,求sql语句? ado.net访问MSSQL最多可以使用多少个参数? sql2000 拼字符串问题 Sql server 2008 循环表数据的问题 求助各位,烦恼的sql语句.. 如何在不删除表中记录的情况下重置identity列? 分类汇总的平均值如何求? 在sql server 2000 中存放文本内容合适吗? SQL2005数据库同步到SQL2008 新手求SQL语句
1. 你的 create table xxx .. 语句
2. 你的 insert into xxx ... 语句
3. 结果是什么样,(并给以简单的算法描述)
4. 你用的数据库名称和版本(经常有人在MS SQL server版问 MySQL)
{
//在formload时绑定数据表yg到comboBox1
SqlConnection conn=new SqlConnection("server=.;uid=sa;pwd=;database=gz");conn.Open();
SqlDataAdapter da=new SqlDataAdapter("select * from sys.objects where type='P' and name not like 'sp_%'",conn);
DataSet ds=new DataSet();
da.Fill(ds,"yg");DataRow dr = ds.Tables["yg"].NewRow();
dr["ygid"] = "0";
dr["ygname"] = "-请选择-";
ds.Tables["yg"].Rows.InsertAt(dr, 0);
this.comboBox1.DataSource=ds.Tables["yg"];
this.comboBox1.DisplayMember="ygname"; //显示的列
this.comboBox1.ValueMember="ygid"; //数据列,次列会在selectedvalue中显示
conn.Close();}