Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. string connectionString = String.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};", _local_dbname);
  2. OleDbConnection connection = new OleDbConnection(connectionString);
  3. try
  4. {
  5. connection.Open();
  6. OleDbCommand command = new OleDbCommand("SELECT * FROM myTable where key = from your variable/memory", connection);
  7. OleDbDataReader reader = command.ExecuteReader();
  8. while (reader.Read())
  9. {
  10. Console.WriteLine("reading row: " + reader["ID"].ToString());
  11. }
  12. reader.Close();
  13. }
  14. catch (Exception ex)
  15. {
  16. // your exception
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement