Create Database Connection in the C#.net
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?
Well, first you need to ensure the database is setup to accept remote connections.
By default, it is not.
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
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?
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
By borceivanovski in forum Java
Last Post: 04-27-2005, 05:35 PM
By karthikeyan in forum VB Classic
Last Post: 11-18-2002, 08:45 AM
Last Post: 11-27-2001, 06:53 AM
By Vaughan in forum Database
Last Post: 06-28-2001, 03:08 PM
By Steve in forum Careers
Last Post: 04-25-2001, 06:51 PM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL