Click here to Skip to main content
15,896,154 members
Home / Discussions / C#
   

C#

 
GeneralRe: Nearly Sorted! Pin
Spanky311-Feb-04 12:21
Spanky311-Feb-04 12:21 
QuestionHow do you do: On Explorer, right click on file -> Open with...-> MyApp.exe ? Pin
mdundek11-Feb-04 7:01
mdundek11-Feb-04 7:01 
AnswerRe: How do you do: On Explorer, right click on file -> Open with...-> MyApp.exe ? Pin
Heath Stewart11-Feb-04 9:43
protectorHeath Stewart11-Feb-04 9:43 
Questionhow to draw an X axis by datetime data! Pin
Member 185560811-Feb-04 4:23
Member 185560811-Feb-04 4:23 
AnswerRe: how to draw an X axis by datetime data! Pin
leppie11-Feb-04 6:05
leppie11-Feb-04 6:05 
GeneralComputer Info Pin
Kenneth Childs11-Feb-04 4:11
Kenneth Childs11-Feb-04 4:11 
GeneralRe: Computer Info Pin
hxxbin11-Feb-04 4:21
hxxbin11-Feb-04 4:21 
GeneralRe: Computer Info Pin
Kenneth Childs11-Feb-04 5:01
Kenneth Childs11-Feb-04 5:01 
GeneralRe: Computer Info Pin
Heath Stewart11-Feb-04 9:38
protectorHeath Stewart11-Feb-04 9:38 
GeneralRe: Computer Info Pin
Heath Stewart11-Feb-04 9:51
protectorHeath Stewart11-Feb-04 9:51 
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 

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.