标题:DataGrid 绑定一个表
只看楼主
andy560225
Rank: 1
来 自:天上
等 级:新手上路
帖 子:72
专家分:0
注 册:2008-10-29
 问题点数:0 回复次数:0 
DataGrid 绑定一个表
private void Form1_Load(object sender, System.EventArgs e)
        {
            string str="server=.;uid=sa;password=;database=test";
            string str1="select * from student";
            SqlConnection con=new SqlConnection(str);
            SqlDataAdapter da=new SqlDataAdapter(str1,con);
            DataSet ds=new DataSet();
            try
            {
                da.Fill(ds,"gao");
                this.dataGrid1.DataSource=ds;
                this.dataGrid1.DataBindings; >>>>>>>>>>>>>>就行代码不对
                
            }
            catch(Exception ee){
                MessageBox.Show(ee.ToString());    
            }
            
        }
是怎么回事啊
搜索更多相关主题的帖子: DataGrid 绑定 
2008-11-20 10:56



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-245321-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.664641 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved