473,387 Members | 3,684 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Databse C# problem

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
7 1521
falaque
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
PRR
750 Expert 512MB
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
Pega
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
Pega
5
fixed it now, so don't worry :).. it was an amateur mistake, even too embarrassing to mention
Feb 10 '09 #5
falaque
12
ha ha ha, its ok Pega, we all do mistake, any way what was the mistake :)
Feb 11 '09 #6
PRR
750 Expert 512MB
its alright ... we all do mistakes.... Please do continue post your queries on Bytes
Feb 11 '09 #7
Pega
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

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

Similar topics

0
by: Jeroen Van Goey | last post by:
Hi, I want to put the OMIM databse locally on my computer. I downloaded the file genemap from ftp://ftp.ncbi.nih.gov/repository/OMIM/ It contains a list of fields, separated by the '|' character....
0
by: Exit12 | last post by:
Hi all I'm new to mysql so easy! I use PHPMyadmin as a front end to administering my databases but my simple question is how do I, from the command line (winxp prompt) drop a certain databse....
11
by: sreenivasan alakappan | last post by:
Hello, I want to create a database applciation in C++. I am using VC++ 6.0 as the deevelopment environment. When I ever i createa project, it only allows me to create a form based normal...
1
by: Elham Ghoddousi | last post by:
I have a problem with my TEMPDB Database.It gets extra size through importing data into one of my databases in same server. How can I shrink my TempDB Databse? Thanks
3
by: xxsodapopxx5 | last post by:
Hello all, i am having a problem deleting a record from the database, i can get it to delete from the dataset with this code. Try ...
2
by: chitrapu | last post by:
hiii everybody, i have a little code that inserts the data into the databse. but the problem is the insertion should be peroformed only when a button is clicked. i have problems in this because i...
2
by: nittin14 | last post by:
hello guys, pls solve my problem my problem is that i m retreive data from table but in some column the value is store NULL. i want that insist of NULL it wl display some text in datalist while...
1
by: Bakarre | last post by:
To display a field from databse and calculate time different -------------------------------------------------------------------------------- Good day, i have problem to display a field from...
11
by: tokcy | last post by:
Hi everyone, I am new in php and ajax, i am facing the prob while i click on element of first drop down then in second dropdown all element showl come from database. I mean i have three dropdown 1....
1
by: PhiriM | last post by:
I am a programmer trying to use access database and forms to build an application. My problem is how to backup and restore the databse then how i may come up with my own custom menu. If anyone...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.