You can solve this problem in a number of ways. I'm assuming here that your connection string is currently in a standard app.config
or web.config
file. Also, this list is almost certainly not exhaustive...
The simplest (but ugliest) is for each user to check out the config file and put their own connection string in locally. This works, but you will get unnecessary changes checked in to the config file.
If your developers are all using local instances of SQL and the database name is the same on each machine, you can simply use
localhost
or127.0.0.1
in your connection string to point at the local machine. This will work on all machines as long as the database name is consistent.You can move the connection string out of the config file, into a separate file or location that is not checked into TFS. For example, you could check for a
userOverrides.config
file (that you never check in), or pull the connection string from the registry instead. You could still use the core configuration file to provide a default value, but nobody would need to edit it for day-to-day work.