string str_oleConn = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\;Extended Properties=dBASE IV;";
            System.Data.OleDb.OleDbConnection ole_conn = new System.Data.OleDb.OleDbConnection(str_oleConn);

            try
            {
                ole_conn.Open();
                System.Data.OleDb.OleDbCommand cmd1 = new System.Data.OleDb.OleDbCommand
                        ("Create Table xxx (Field1 int, Field2 char(10))",
                        ole_conn);
                System.Data.OleDb.OleDbCommand cmd2 = new System.Data.OleDb.OleDbCommand
                        ("Insert Into xxx values (1,'Hello3')", ole_conn);
                System.Data.OleDb.OleDbCommand cmd3 = new System.Data.OleDb.OleDbCommand
                        ("Insert Into xxx values (2,'Hello4')", ole_conn);
                cmd1.ExecuteNonQuery();
                cmd2.ExecuteNonQuery();
                cmd3.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                ole_conn.Close();
            }

相关文章:

  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
猜你喜欢
  • 2021-07-24
  • 2021-11-27
  • 2022-12-23
  • 2018-12-22
  • 2022-12-23
  • 2021-11-17
相关资源
相似解决方案