When we connect to the database in ASP.NET, you must specify the appropriate connection string. However, most other cases where data must be specified are performed inside the object.
For example, why cannot we have connection objects such as:
var connection = new connectionObject(){
DataSource = "myServerAddress",
IntialCatalog = "myDataBase",
UserId = "myUsername",
Password = "myPassword"
}
which is much better than a key / value string:
Data Source = myServerAddress; Start Directory = MyDatabase; UserId = MyUserName; Password = MyPassword;
The only reason I can think of is to allow storage in web.config, but nothing would stop us from storing individual values ββin it.
I am sure there are good reasons, but what is it?