Sunday 15 July 2012

Example of Where cluase query including the MSACCESS database connection in C# -


Similar to the title. An example of just Oleb connections where the clause is from the query.

  private function SendQueryToOLE () As DataSet Dim rdrDataReader as OleDb.OleDbDataReader Dim cmdCommand as OleDb.OleDbCommand dim as dtsData as new DataTable dim as new DataSet dim dtbTable I OleDb.OleDbConnection as String dim oleConnection as integer dim SQLStatement oleConnection.ConnectionString = YourConnectionString SQLStatement = "SELECT * fROM table WHERE field = 1 "oleConnection.Open () cmdCommand = New OleDb.OleDbCommand (SQLStatement, moleConnection) rdrDataReader = to cmdCommand.ExecuteReader () to I = 0 (rdrDataReader.FieldCount - 1) dtbTable.Column.Add (RdrDataReader.GetName (i), RdrDataReader.GetFieldTyp e (i)) next DtbTablekBeginLoadData () Dim value (rdrDataReader.FieldCount - 1) as the object when rdrDataReader.Read Ardeeditaiderkget value (value) Ditibitiblkloddetaaro (value, true) and Ditibitibl. Endloadedata () DTS Data Tabs ADD (DTbTable) Molecognition Closed () Returns Dts Data and Function  

No comments:

Post a Comment