[Solved] Stored Procedure in sql server 2005


Well, the error you are getting doesn’t really have anything to do with stored procedures, but I can answer the question of “how to solve this?” in the context of the exception you are getting.

First, I hope you are not using “something” as the actual connection string to your sql server. You should be using a real connection string. Here are some various examples you can use to connect to SQLServer – http://www.connectionstrings.com/sql-server-2005

Using the first example from the above url

Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

You’ll want to change “myServerAddress” to the ip address or host name of the server. This could be “localhost” or it could be another computer you have on the network. Change “myDataBase” to the name of the database you created, and make sure the name matches exactly as the database might be configured with case sensitivity. And finally change “myUsername” and “myPassword” to the user and password of the account you use to access the server under Sql Server Management Studio.

Now, assuming you have actually done the above, here are some steps you can take to debug connection issues.

  1. Ping the computer – from and command prompt type “ping servername” where servername is the name or ip address of the server that runs SQL Server. If you don’t get a response from the server then you need to debug your local network.

  2. If the server is running locally try using “.” for the “myServerAddress” value. If it’s sqlserver express edition, use the express format – “.\SQLExpress” or “myServerAddress\SQLExpress”

  3. If SQL Server is running on another computer try each of the three links under the section “More Information” from this kb article – http://support.microsoft.com/kb/914277 That will ensure remote connections are supported.

But the real issue is that you cannot connect to the database. I recommend searching for solutions to that problem first. Or perhaps supply more information about your setup here on SO in a different question.

Hope that helps,
-Marcus

solved Stored Procedure in sql server 2005