I\'m getting the following error:
Login failed for user \'sa\'
When I try to connect server by setting value through a string v
put your connectionstring in web.config file as I show below
Above "Test" is connectionstringname,you can write your datasource name.Mine is Harsh,so changed it according to yours.Give your database name in inital catalog.
And then put this code in your code behind page load event
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Test"].ToString());
It will work.