• OleDbSqlHelper使用例子


            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!");
            }

  • 相关阅读:
    Html: Iframe用法总结参考
    Fire fox最佳实践
    HTML字符实体(Character Entities),转义字符串(Escape Sequence)
    asp.net mvc session, filter 应用研究
    jQuery Gallery Plugin
    Jquery 最佳实践
    JS对象转Json格式,Json格式转Object
    Web前端开发(JQuery)
    移动终端 WAP 应用探索
    discuzcode函数
  • 原文地址:https://www.cnblogs.com/shiningrise/p/1979211.html
Copyright © 2020-2023  润新知