Enterprise Library Edit Connection And Check -


i have created connection , fetching data using method given in code section. want way take database , server name input user , save same connection string i.e. "connstring" in case in app.config file. need way check whether new server name , database name correctly provided user(i mean makes successfull connection). please help.

private database _db = enterpriselibrarycontainer.current.getinstance<database>("connstring"); 

enterprise library doesn't along these lines. change connection string section in config file, you'll need go through configurationmanager class connectionstringssection , modify that. depending on environment , security settings may not have permissions write config file, though, warned.

validating server name , database name require writing database specific code - i'm not sure off top of head how / if it's done.


Comments