Databse C# problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pega
    New Member
    • Feb 2009
    • 5

    Databse C# problem

    Hi, i have a problem while trying to build my program, i have this code in the Form 1 Load :
    Code:
    private void Form1_Load(object sender, System.EventArgs e)
    		{
    			objOleDbConnection.Open();
    		    
    			OleDbDataReader objReader = objSelectAccount.ExecuteReader();    <<< Breaks here
    			
    			while (objReader.Read()) 
    			{
    				cmbAccountNumbers.Items.Add(objReader["Account Number"]);
    			}
    			objOleDbConnection.Close();
    		}
    and shows me this error :"An unhandled exception of type 'System.Data.Ol eDb.OleDbExcept ion' 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
    Last edited by pbmods; Feb 10 '09, 12:11 AM. Reason: Added CODE tags.
  • falaque
    New Member
    • Feb 2009
    • 12

    #2
    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.

    Comment

    • PRR
      Recognized Expert Contributor
      • Dec 2007
      • 750

      #3
      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?

      Comment

      • Pega
        New Member
        • Feb 2009
        • 5

        #4
        "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..

        Comment

        • Pega
          New Member
          • Feb 2009
          • 5

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

          Comment

          • falaque
            New Member
            • Feb 2009
            • 12

            #6
            ha ha ha, its ok Pega, we all do mistake, any way what was the mistake :)

            Comment

            • PRR
              Recognized Expert Contributor
              • Dec 2007
              • 750

              #7
              its alright ... we all do mistakes.... Please do continue post your queries on Bytes

              Comment

              • Pega
                New Member
                • Feb 2009
                • 5

                #8
                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

                Comment

                Working...