+ Reply to Thread
Results 1 to 1 of 1

Thread: I'm an idiot, but... mySQL with c#

  1. #1
    thegriff is offline x10Hosting Member thegriff is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    14

    I'm an idiot, but... mySQL with c#

    I know it's probably simple, but it's driving me round the bend.
    I have created and populated a db using phpmyadmin, and created a local copy for testing.
    I have created a web.config file in the root of public_html:

    <?xml version="1.0" ?>
    <configuration>
    <appSettings />
    <connectionStrings />
    <system.web>
    <customErrors mode="Off" />
    </system.web>
    </configuration>

    and a two page website: Default.aspx / Default.aspx.cs and Page2.apsx / Page2.aspx.cs - the former navigating to the later.
    If Page2.aspx.cs contains the lines:

    using MySql.Data.MySqlClient;
    privateMySqlCommand sqlCmd;
    privateMySqlConnection hookUp;
    privateMySqlDataReader reader;

    Then when I navigate to Page2, i just get an error:
    Server Error in '/' Application

    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
    ...

    I haven't even tried to connect to the data base yet! It all works localy, complete with code added to connect to mySQL database, filter content and display, so what stupid mistake have I made?
    Any help will be much appreciated.
    Edit:
    [SOLVED]

    I sorted it - it's amazing how asking for help clears the brain!

    Solution: Create a "bin" directory, and upload the "mySQL.Data.dll" to it. This effectively provides the reference as well as the assembly.

    I knew I was an idiot...
    Last edited by thegriff; 10-04-2009 at 06:40 AM. Reason: Automerged Doublepost

+ Reply to Thread

Similar Threads

  1. [PHP] MySQL and PHP
    By Bryon in forum Tutorials
    Replies: 43
    Last Post: 03-24-2011, 07:27 AM
  2. Which is better postgresql or MySQL?
    By Kurai Kumo in forum Scripts & 3rd Party Apps
    Replies: 11
    Last Post: 12-10-2009, 08:17 AM
  3. Replies: 14
    Last Post: 09-29-2008, 07:07 PM
  4. New Site-Suggestions?
    By mnoutside in forum Review My Site
    Replies: 9
    Last Post: 08-27-2008, 07:01 AM
  5. Have a problem with my forum
    By tikloos in forum Scripts & 3rd Party Apps
    Replies: 43
    Last Post: 01-19-2006, 01:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers