This should have been posted in the .net forumhttp://www.sqlteam.com/forums/forum.asp?FORUM_ID=17More likeWEBCONFIG <connectionStrings> <add name="My_ConnectionString" connectionString="Data Source=xx.xx.xxx.xxx,2433;Network Library=DBMSSOCN;Initial Catalog=Mydatabase;User ID=username;Password=password;" providerName="System.Data.SqlClient"/> </connectionStrings>
For more details on your connection string see www.connectionstrings.com CLASSAm not sure from your code if you are running a SP or what ? But try thisDont forget to declare your SQL namespaceusing System.Data.SqlClient;SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["My_ConnectionString"].ConnectionString.ToString()); SqlCommand command = new SqlCommand("SP_Name", con); command.CommandType = CommandType.StoredProcedure; command.CommandTimeout = 20; con.Open();