A network-related or instance-specific error occurred
while
establishing a connection to SQL Server
What I have tried:
i also using crystal report (32-bit,64-bit)according to client computer and also install sql server management studio because i am using local server db but i dont add database in client sql server managament studio. when i deploy again but it give same error message about sql server.
The connection string that you use for development is unlikely to work in production - in fact it definitely should not work as developing software against the production database is a good way to learn "I really should have a better backup system" ... it is far too easy to damage or destroy a database through a minor software bug while developing code!
So start with your app: do you hardcode the connection? If so, that needs fixing - connection strings should always be stored in an app config file so they can be changed without recompilation.
Then check the config file the user is using: make sure he can access the Sql Server instance, and that his Sql login credentials are valid for the access he needs to the actual database your code uses. Then check the instance contains the actual database and that it's tables and data are up-to-date with what you code expects.
Sorry, but we can't do any of that for you!
As Griff suggested, put the connections string in a file, or as a defualt on your inteface. If you test the Crystal report on the same machine as the server and it works, but gives you an error when you run the report from another machine, there can be a few things to try. install SSMS on the remote machine and try connecting to the server from there. if it times out and does not connect, there are probably two main reasons
1 - the server is not listening, TCP/IP port are usually off by default. see link
Enable or Disable a Server Network Protocol - SQL Server | Microsoft Docs
[
^
]
2 - Try using "server Authentication" rather than "windows authentication". SQL Server in Microsoft Docs is a good place to start (search for "Change server authentication mode" link
Microsoft SQL documentation - SQL Server | Microsoft Docs
[
^
] if server authentication works, but windows authentication doesn't, it is most likely permissions on the server need setting up, Google for SQL scripts that set permissions. You may also need to get both client and sever machines asdded to the same domain and user group for windows authentication to work
there can be numerous reasons, but these were the two that worked for me, setting the ports to listen, and permissions.
Read the question carefully.
Understand that English isn't everyone's first language so be lenient of bad
spelling and grammar.
If a question is poorly phrased then either ask for clarification, ignore it, or
edit the question
and fix the problem. Insults are not welcome.
Don't tell someone to read the manual. Chances are they have and don't get it.
Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.