zoukankan      html  css  js  c++  java
  • BindingSoure和BindingNavigator 用法实例

     private BindingSource myBindingSource = new BindingSource();
            OracleConnection conn = new OracleConnection("Data Source=xxx;Persist Security Info=True;User ID=xxx;Password=xxx");

            private void Form1_Load(object sender, EventArgs e)
            {
              
                string sql3 = "select * from xxxx ";
                OracleCommand cmd3 = new OracleCommand(sql3, conn);
                OracleDataAdapter oda = new OracleDataAdapter(cmd3);
                DataSet ds = new DataSet();
                oda.Fill(ds);
                myBindingSource.DataSource = ds.Tables[0];              //绑定数据源
                this.bindingNavigator1.BindingSource = myBindingSource; //数据源跟bindingNavigator1控件相连

                this.dataGridView1.DataSource = myBindingSource;        //数据源跟dataGridView1控件相连


                this.textBox1.DataBindings.Add("Text", myBindingSource, "IP");//数据源跟textBox1控件相连


            }

            private void button1_Click(object sender, EventArgs e)
            {
                myBindingSource.MoveNext();
            }

            private void button2_Click(object sender, EventArgs e)
            {
                myBindingSource.MovePrevious();
            }

  • 相关阅读:
    LeetCode 面试题56-I
    LeetCode T2
    统计中的AUC和ROC曲线
    【转载】RNN
    One layer SoftMax Classifier, "Handwriting recognition"
    【转载】深度学习中softmax交叉熵损失函数的理解
    【转载】softmax的性质及其实现
    logistics多分类
    logistics二分类
    多元线性回归
  • 原文地址:https://www.cnblogs.com/timy/p/1424104.html
Copyright © 2011-2022 走看看