I wanted to know that can I have 2 or more web.config files in my web project? If yes then how the compiler will check the connection string?
You can have multiple configuration files in your project at the same level too. We do it like this. We have one main configuration file (Web.Config), then we have two more configurations files. App.Config and Database.Config. in App.Config we defined all the application level settings. in Database.Config we define all the database level settings. And in Web.Config we refer App.Config and Database.Config like this:
Also , you can have multiple web.config files in sub directories. Settings will be override automatically by asp.net.