标题:求助:总报“执行 CreateHandle() 时无法调用值 Dispose()。”或“未将对象 ...
只看楼主
sxfplf
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2013-8-12
结帖率:0
已结贴  问题点数:10 回复次数:1 
求助:总报“执行 CreateHandle() 时无法调用值 Dispose()。”或“未将对象引用设置到对象的实例。”
namespace ShowDataGridView
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            Control.CheckForIllegalCrossThreadCalls = false;
        }

        int time=0;

        private void ShowDataGridView()
        {
            using (SqlConnection conn = new SqlConnection(@"server=.\SQLEXPRESS;database=DataSqlExpress;uid=datawriter;pwd=123456"))
            {

                SqlDataAdapter da = new SqlDataAdapter("select * from Temp_TABLE", conn);
                DataSet ds = new DataSet();
                da.Fill(ds);
                dataGridView.DataSource = ds.Tables[0];
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {                       
            this.timer1.Interval=1000;
            this.timer1.Start();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            time++;
            if (time >= 10)
            {
                Thread td = new Thread(new ThreadStart(ShowDataGridView));
                td.Start();
                time = 0;
            }
        }
    }
}


如题,求助!!
搜索更多相关主题的帖子: database private public server false 
2013-09-04 12:25
303770957
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:小飞侠
威 望:6
帖 子:838
专家分:2125
注 册:2005-9-10
得分:10 
根据你的错误提示信息: CreateHandle() 时无法调用值 Dispose()。这两个函数你没有贴出来。我怎么帮助你?

♂ 死后定当长眠,生前何须久睡。♀
2013-09-05 14:15



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




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

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