本文整理匯總了C#中ADODB.Recordset.Requery方法的典型用法代碼示例。如果您正苦於以下問題:C# ADODB.Recordset.Requery方法的具體用法?C# ADODB.Recordset.Requery怎麽用?C# ADODB.Recordset.Requery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ADODB.Recordset
的用法示例。
在下文中一共展示了ADODB.Recordset.Requery方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TestRefreshDataTableWithADODBRecordSet_Schema
public void TestRefreshDataTableWithADODBRecordSet_Schema()
{
OleDbDataAdapter adapter = new OleDbDataAdapter();
adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
DataSet stuDS = new DataSet();
DataTable stuTable = new DataTable("student");
stuDS.Tables.Add(stuTable);
//Use ADO objects from ADO library (msado15.dll) imported
// as.NET library ADODB.dll using TlbImp.exe
ADODB.Connection adoConn = new ADODB.Connection();
ADODB.Recordset adoRS = new ADODB.Recordset();
adoConn.Open("Provider=CUBRIDProvider;Location=test-db-server;Data Source=demodb;User Id=dba;Port=30000", "", "", -1);
adoRS.Open("SELECT * FROM student", adoConn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockReadOnly, 1);
adapter.Fill(stuTable, adoRS);
adoRS.Requery(0);
int refreshRowCount = adapter.Fill(stuTable, adoRS); // This method does not call Close on the ADO object when the fill operation is complete.
adoRS.Close();
adoConn.Close();
Assert.IsNotNull(stuTable.PrimaryKey);
Assert.AreEqual(3, refreshRowCount);
}