文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>OleDbSqlHelper使用例子

OleDbSqlHelper使用例子

时间:2011-03-09  来源:五年

        private void button1_Click(object sender, EventArgs e)
        {
            //       this.bindingSource1.DataSource = Bmk.FindAll();
            this.bindingSource1.DataSource =
                OleDbHelper.ExecuteDataTable(Conn.AccessConnection,
                @"select * from bmk order by bmxh ");
            this.dataGridView1.DataSource = bindingSource1;

            this.label1.Text = Bmk.GetCount(Condition.Empty).ToString();
            //      MessageBox.Show(Bmk.FindById(1).xm);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            int i = 0;
            foreach (var bmk in Bmk.FindAll())
            {
                if (!string.IsNullOrWhiteSpace(bmk.tcxm))
                {
                    OleDbParameter[] param = new OleDbParameter[2];
                    param[0] = OleDbHelper.CreateInParam("tcxm",OleDbType.Char,2, bmk.tcxm);
                    param[1] = OleDbHelper.CreateInParam("bmxh", OleDbType.Char, 9, bmk.bmxh);
                    string strSql = @"update bmk set tcxm = ? where bmxh = ? ";
                    OleDbHelper.ExcuteSQL(Conn.VfpConnection, strSql, param);

                    //string strSql = string.Format("update bmk set tcxm = '{0}' where bmxh = '{1}' ",
                    //    bmk.tcxm, bmk.bmxh);
                    //OleDbHelper.ExcuteSQL(Conn.VfpConnection, strSql);
                }
                i++;
                //if (i > 10)
                //    break;
            }
            MessageBox.Show("OK!");
        }

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载