I am newbie in this .NET and please don\'t mind in answering my simple question. I am trying to write a windows application, where in I am using a localhost SQLserver for da
string str = @"Data Source=HARIHARAN-PC\SQLEXPRESS;Initial Catalog=master;Integrated Security=True" ;
Choose a database name in Initial Catalog
Data Source=HARIHARAN-PC\SQLEXPRESS;Initial Catalog=your database name;Integrated Security=True" ;
see more
Try this connection string.
Data Source=HARIHARAN-PC\\SQLEXPRESS;Initial Catalog=yourDataBaseName;Integrated Security=True
See this link for more details http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring%28v=vs.110%29.aspx
string str = "Data Source=HARIHARAN-PC\\SQLEXPRESS;Initial Catalog=master;Integrated Security=True" ;
Do You have Internal Connection or External Connection. If you did Internal Connection then try this:
"Data Source=.\SQLEXPRESS;AttachDbFilename="Your PAth .mdf";Integrated Security=True;User Instance=True";
use this connection string :
Server=HARIHARAN-PC\SQLEXPRESS;Intial Catalog=persons;Integrated Security=True;
rename person with your database name