Tabels & Comboboxes
-
Hi I got an access database. is it possible to put the tables of this database in a combobox? If yes then how? the underdog
-
Hi I got an access database. is it possible to put the tables of this database in a combobox? If yes then how? the underdog
Hi Use the following snippet for retrieving table names.... OleDbConnection connection = new OleDbConnection(); connection.Open(); object[] restrictions; restrictions = new object[] {null , null , null , "TABLE"}; DataTable table; table = connection.GetOleDbSchemaTable(OleDbSchemaGuid.Columns,restrictions); connection.Close(); then, this.cmbTables.DataSource = table; this.cmbTables.DisplayMember = "TABLE"; I hope it works for you.
-
Hi Use the following snippet for retrieving table names.... OleDbConnection connection = new OleDbConnection(); connection.Open(); object[] restrictions; restrictions = new object[] {null , null , null , "TABLE"}; DataTable table; table = connection.GetOleDbSchemaTable(OleDbSchemaGuid.Columns,restrictions); connection.Close(); then, this.cmbTables.DataSource = table; this.cmbTables.DisplayMember = "TABLE"; I hope it works for you.
First of all get rid of the new table names stuff and check if you can read data from the tables by using your OleDb code. Fill some sample data in Access and use .. . . . . string sqlSelectStatement = "SELECT * FROM "; OleDbDataAdapter adapter = new OleDbDataAdapter =(sqlSelectStatement,connection); connection.Open(); DataTable table = new DataTable(); try { adapter.Fill(table); } connection.Close(); Now look in table and tell the result.
-
First of all get rid of the new table names stuff and check if you can read data from the tables by using your OleDb code. Fill some sample data in Access and use .. . . . . string sqlSelectStatement = "SELECT * FROM "; OleDbDataAdapter adapter = new OleDbDataAdapter =(sqlSelectStatement,connection); connection.Open(); DataTable table = new DataTable(); try { adapter.Fill(table); } connection.Close(); Now look in table and tell the result.
I get the containment of the Table. So that works as it should But how to go on now? The underdog
-
I get the containment of the Table. So that works as it should But how to go on now? The underdog