topmount

private void button2_Click(object sender, EventArgs e)
        {
            GetMessage();
        }

        private DataTable GetMessage() {
            string P_Str_ConnectionStr = string.Format("server={0};user id = {1};port = {2};database=my_db2;pooling = false;", "localhost", "root", 3306);
            string P_Str_SqlStr = string.Format("SELECT id,name FROM student");
            MySqlDataAdapter adapter = new MySqlDataAdapter(P_Str_SqlStr,P_Str_ConnectionStr);
            DataTable P_dt = new DataTable();
            adapter.Fill(P_dt);
            this.dataGridView1.DataSource = P_dt;
            return P_dt;
        }

分类:

技术点:

相关文章:

  • 2021-12-24
  • 2021-12-09
  • 2022-01-20
  • 2021-11-01
  • 2021-11-02
  • 2021-09-29
  • 2021-09-27
  • 2021-11-20
猜你喜欢
  • 2021-09-29
  • 2021-08-17
  • 2021-12-02
  • 2021-12-10
  • 2022-01-07
  • 2021-11-21
  • 2021-11-28
相关资源
相似解决方案