There are lots of settings in the connectionstring for SQL server, I would visit connectionstrings.com or msdn.microsoft.com to get all the details. But GENERALLY you needs just a handful of settings. Data Source - this is your server, and instance name, localhost
, .
, and (local)
are all aliases to your local machine. If you are using anything other than the default instance, like SQLExpress, you need to add it after the servername, with a backslash. User Instance - this is required if you are using SQLExpress and changes how the database is mounted. AttachDbFilename - is the database file you wish to attach. Initial Catalog - the name of the database you want to connect to. So your new connection string, assuming a database name of "cars" on a default instance on your local server using integrated security (so you don't have to store usernames and passwords). It would look like this
Data Source=(local);Initial Catalog=cars; Integrated Security=SSPI;
Notice the AttachDbFilename and User Instance parameters have been removed.