DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2007

    Create Database Connection in the C#.net

    hello all,

    I have database named 'Marketing', and want to bound DropDownList control with it using 'add connection' dialog box in the C#.net.

    I gave datasource: 'Microsoft SQL Server Database File (SqlClient)'. And when I give DataBase file name as 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\Marketing_Data.MDF', I get error while testing the connection:
    "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that
    under default settings SQL Server dose not allow remote connections. (Provider:SQL Network Interfaces, error: 26-Error Locating Server/Instance specified)".

    So what DataBase File name I should give here for completing the database binding?


  2. #2
    Join Date
    Apr 2007
    Sterling Heights, Michigan
    Well, first you need to ensure the database is setup to accept remote connections.

    By default, it is not.

  3. #3
    Join Date
    Nov 2003
    Portland, OR
    Ignore the error message; if you're running SQL on the same computer as your application, your problem has nothing to do with remote connections.

    Which version of SQL are you using? Is it SQL 2005 Express, or SQL Server? What does your connection string look like?
    Phil Weber

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Java and MS access database connection
    By borceivanovski in forum Java
    Replies: 1
    Last Post: 04-27-2005, 05:35 PM
  2. Replies: 1
    Last Post: 11-18-2002, 08:45 AM
  3. Getting a GUI to function
    By Eric in forum Java
    Replies: 1
    Last Post: 11-27-2001, 06:53 AM
  4. Replies: 0
    Last Post: 06-28-2001, 03:08 PM
  5. Replies: 0
    Last Post: 04-25-2001, 06:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.