Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
sir plz help me when i install my window form application another machine database not connected

ERROR:-
ASM
Unhandle Exception has occurred in your application.

A network related or instance- specific error occurred while establishing a connection to sql server. the server was not found or was not accessible. verify that the instance name is correct and that sql server  is configured to allow remote connection(provide: SQL network interfaces, error:-26 ERROR locatings server/intance specified)
Posted
Comments
Herman<T>.Instance 2-Sep-14 1:58am    
how does your connectionstring match the real database?
Nishant.Chauhan80 2-Sep-14 2:08am    
how to modify connection another machine
syed shanu 2-Sep-14 2:02am    
Where do you Install.Is the Connection string match to your present installed computer.is Db in same computer or in Network.is your connection string in your application is hardcoded or you can edit it

The chances are that you have hardcoded your connection string - included it as a string in your source code - and that the first thing you need to do is change that to use a configuration file of some description.

The simplest is to use the Settings.Settings file:
1) Open your projects Properties in the solution explorer, and double click on "Settings.settings"
2) In the resulting grid, change the Name to "MySetting", and set the Value to "Defaulted value". Leave Type and Scope as "string" and "User" respectively.
3) Save and close the settings window.
4) To read your setting:
string s = Properties.Settings.Default.MySetting;
5) To write your setting:
Properties.Settings.Default.MySetting = "My new setting value";
Properties.Settings.Default.Save();


Then you need to provide a mechanism for changing the configuration file so that you can set the appropriate connection string for the new environment. What that will be we can't say: most development SQL server instances tend to use Windows authorisation for log in, while production ones are generally username and password protected - you will have to find out from the db admin what the string should be.
 
Share this answer
 
First of all check which database you are using. If it is SQL Server then check the database connection string.

The best way is to use the inbuild database which will not create any issue regrading the changing the connection string.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900