Click here to Skip to main content
16,021,757 members
Home / Discussions / C#
   

C#

 
GeneralRe: Computer Info Pin
Daniel Turini11-Feb-04 4:33
Daniel Turini11-Feb-04 4:33 
Generalcreating and editing Resource files Pin
POKRI11-Feb-04 3:57
POKRI11-Feb-04 3:57 
GeneralRe: creating and editing Resource files Pin
OmegaSupreme11-Feb-04 9:29
OmegaSupreme11-Feb-04 9:29 
GeneralRe: creating and editing Resource files Pin
Heath Stewart11-Feb-04 9:34
protectorHeath Stewart11-Feb-04 9:34 
GeneralPDF Viewer Pin
Mahesh Varma11-Feb-04 2:34
Mahesh Varma11-Feb-04 2:34 
GeneralRe: PDF Viewer Pin
Heath Stewart11-Feb-04 2:53
protectorHeath Stewart11-Feb-04 2:53 
GeneralTable Names Of a MS Access Database Pin
Daminda11-Feb-04 1:06
Daminda11-Feb-04 1:06 
GeneralRe: Table Names Of a MS Access Database Pin
Heath Stewart11-Feb-04 3:04
protectorHeath Stewart11-Feb-04 3:04 
Why don't you tell us what that error reads? D'Oh! | :doh:

Besides, why are you using ADO.NET? It's much faster and for what you need can accomplish the same things. Your connection string doesn't change (although you could drop most of those options since they are mostly defaults and other unnecessary properties), nor does your SQL statement, just the code itself. This is, after all, the C# forum - a language targeting the CLR - so writing .NET applications and libraries is what this is about:
OleDbConnection conn = new OleDbConnection(string.Format(
  "Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Mode=ReadWrite",
  txtDbPath.Text));
OleDbCommand cmd = conn.CreateCommand();
cmd.CommandText = "SELECT Name FROM MSysObjects WHERE Type = 1";
OleDbDataReader reader = null;
try
{
  conn.Open();
  reader = cmd.ExecuteReader();
  while (reader.Read())
  {
    Console.WriteLine(reader.GetString(0));
  }
}
catch (Exception e)
{
  // Providing something like this in your message would've helped us
  // determine what the problem was!
  Console.Error.WriteLine("An error occured: {0}", e.Message);
}
finally
{
  if (reader != null) reader.Close();
  conn.Close();
}


 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Table Names Of a MS Access Database Pin
Spanky311-Feb-04 8:18
Spanky311-Feb-04 8:18 
GeneralWe are inviting you to hotdotnet. Pin
Anonymous11-Feb-04 0:19
Anonymous11-Feb-04 0:19 
GeneralRe: We are inviting you to hotdotnet. Pin
Corinna John11-Feb-04 0:38
Corinna John11-Feb-04 0:38 
GeneralRe: We are inviting you to hotdotnet. Pin
Uwe Keim11-Feb-04 1:43
sitebuilderUwe Keim11-Feb-04 1:43 
GeneralBinding array to combobox Pin
Anonymous10-Feb-04 20:05
Anonymous10-Feb-04 20:05 
QuestionPanel Control covering my other controls... IDE BUG? Pin
gordingin10-Feb-04 16:15
gordingin10-Feb-04 16:15 
AnswerRe: Panel Control covering my other controls... IDE BUG? Pin
Heath Stewart11-Feb-04 3:14
protectorHeath Stewart11-Feb-04 3:14 
GeneralC# communication with events Pin
MusicAlly10-Feb-04 14:45
MusicAlly10-Feb-04 14:45 
GeneralRe: C# communication with events Pin
Kentamanos10-Feb-04 15:35
Kentamanos10-Feb-04 15:35 
GeneralRe: C# communication with events Pin
MusicAlly10-Feb-04 16:54
MusicAlly10-Feb-04 16:54 
GeneralRe: C# communication with events Pin
Heath Stewart11-Feb-04 3:52
protectorHeath Stewart11-Feb-04 3:52 
GeneralCompiler Optimizations Pin
Andrew Shapira10-Feb-04 13:44
Andrew Shapira10-Feb-04 13:44 
GeneralVS-style colors Pin
Judah Gabriel Himango10-Feb-04 10:30
sponsorJudah Gabriel Himango10-Feb-04 10:30 
GeneralRe: VS-style colors Pin
Heath Stewart10-Feb-04 11:33
protectorHeath Stewart10-Feb-04 11:33 
GeneralRe: VS-style colors Pin
Uwe Keim11-Feb-04 1:47
sitebuilderUwe Keim11-Feb-04 1:47 
GeneralRe: VS-style colors Pin
Judah Gabriel Himango11-Feb-04 4:48
sponsorJudah Gabriel Himango11-Feb-04 4:48 
GeneralRe: VS-style colors Pin
Heath Stewart11-Feb-04 5:12
protectorHeath Stewart11-Feb-04 5:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.