string strcmd = "select * from BB";
string strcn = "Provider=SQLOLEDB;Initial Catalog=test;Data Source=MHRREQ08;User ID=sa;Password=;";
DataTable dt = new DataTable();
System.Data.OleDb.OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter();
ADODB.Connection strcon = new ADODB.Connection();
strcon.Open(strcn, null, null, 0);
ADODB.Recordset rs = new ADODB.Recordset();
rs.Open(strcmd, strcon, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic, -1);
string strcn = "Provider=SQLOLEDB;Initial Catalog=test;Data Source=MHRREQ08;User ID=sa;Password=;";
DataTable dt = new DataTable();
System.Data.OleDb.OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter();
ADODB.Connection strcon = new ADODB.Connection();
strcon.Open(strcn, null, null, 0);
ADODB.Recordset rs = new ADODB.Recordset();
rs.Open(strcmd, strcon, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic, -1);
da.Fill(dt, rs);
dataGridView1.DataSource = dt;
rs.Close();
strcon.Close();
浙公网安备 33010602011771号