private void DataList1_DblClick(System.Object eventSender, System.EventArgs eventArgs) { // ERROR: Not supported in C#: OnErrorStatement if (string.IsNullOrEmpty(DataList1.BoundText)) { return; } int lID = 0; lID = Convert.ToInt32(DataList1.BoundText); switch (gSection) { case -1: gID = Convert.ToInt32(DataList1.BoundText); this.Close(); break; case 0: My.MyProject.Forms.frmStockItem.loadItem(ref Convert.ToInt32(DataList1.BoundText)); //* Hiding frmstocklist // frmStockList.Hide //* frmStockItem formIten = null; formIten.Show(); break; case 1: My.MyProject.Forms.frmStockPricing.loadItem(ref Convert.ToInt32(DataList1.BoundText)); //* Hiding Stocklist // frmStockList.Hide //* frmStockPricing formPrice = null; formPrice.Show(); break; } if (modApplication.blNextItem == true) { gRS.Requery(); //UPGRADE_NOTE: Refresh was upgraded to CtlRefresh. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"' DataList1.CtlRefresh(); modApplication.blNextItem = false; } }
public void TestRefreshDataTableWithADODBRecordSet_Schema() { OleDbDataAdapter adapter = new OleDbDataAdapter(); 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); }
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); }