By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,994 Members | 2,063 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,994 IT Pros & Developers. It's quick & easy.

Databse C# problem

P: 5
Hi, i have a problem while trying to build my program, i have this code in the Form 1 Load :
Expand|Select|Wrap|Line Numbers
  1. private void Form1_Load(object sender, System.EventArgs e)
  2.         {
  3.             objOleDbConnection.Open();
  4.  
  5.             OleDbDataReader objReader = objSelectAccount.ExecuteReader();    <<< Breaks here
  6.  
  7.             while (objReader.Read()) 
  8.             {
  9.                 cmbAccountNumbers.Items.Add(objReader["Account Number"]);
  10.             }
  11.             objOleDbConnection.Close();
  12.         }
  13.  
and shows me this error :"An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll"

the interesting thing is that it throws me the same error in college computers in one campus, and was building fine on other college campus and at home, but now is breaking at home as well.

Any suggestions?

Thank you
Feb 9 '09 #1
Share this Question
Share on Google+
7 Replies


P: 12
there might be some problem with data base installation. try using another data base using a small program, just to make sure that its not problem with data base.
Feb 10 '09 #2

Expert 100+
P: 750
PRR
1. Are you sure your connection string and username password are valid?
2. Make sure your database serve is on?

Do go through Database
Your code doesn't seem to be complete... can you provide more sample code?
Feb 10 '09 #3

P: 5
"1. Are you sure your connection string and username password are valid?
2. Make sure your database serve is on?

Do go through Database
Your code doesn't seem to be complete... can you provide more sample code? "


the database does not have have a username or password, so i don't think its that, and the database server is on :\
I have also tried to build my the backup of the application which i created over a month ago, and the same problem is happening, so i presume its ether my security settings or the computer itself.. hmm..
Feb 10 '09 #4

P: 5
fixed it now, so don't worry :).. it was an amateur mistake, even too embarrassing to mention
Feb 10 '09 #5

P: 12
ha ha ha, its ok Pega, we all do mistake, any way what was the mistake :)
Feb 11 '09 #6

Expert 100+
P: 750
PRR
its alright ... we all do mistakes.... Please do continue post your queries on Bytes
Feb 11 '09 #7

P: 5
Basically, I have made my project on my USB drive, so i can take work to college and work there too, and when I created the link between the program and database, the directory was through F: drive, and when it was crashing the name of the USB was U: or G:, but it was still looking for F: drive :\
Rookie mistake
Feb 11 '09 #8

Post your reply

Sign in to post your reply or Sign up for a free account.