I am new to C# and trying to connect to SQL Server for a demo query.
This is my shortcode for the same.
SqlConnection conn = new SqlConnection("data source=.; database=Sample; integrated security=SSPI");
SqlCommand cmd = new SqlCommand("select * from employees", conn);
conn.Open();
when I am running the script it is showing error at conn.Open() stating that cannot find the server.
When I googled it further I found that the SQL server browser should run in this case which is not there in my system. Any idea how can I make it reach the server?
I saw posts on StackOverflow Cannot connect to sql server but they seem to have different issue and solution.
Thanks in advance!