Question:You need to write a code segment that will add a string named strConn to the connection string section of the application configuration file. Which code segment should you use? 

A Dim myConfig As Configuration = _
ConfigurationManager.OpenExeConfiguration( _
ConfigurationUserLevel.None)
myConfig.ConnectionStrings.ConnectionStrings.Add( _
New ConnectionStringSettings("ConnStr1", strConn))
myConfig.Save() 

B Dim myConfig As Configuration = _
ConfigurationManager.OpenExeConfiguration( _
ConfigurationUserLevel.None)
myConfig.ConnectionStrings.ConnectionStrings.Add( _
New ConnectionStringSettings("ConnStr1", strConn))
ConfigurationManager.RefreshSection("ConnectionStrings") 

C ConfigurationManager.ConnectionStrings.Add( _
New ConnectionStringSettings("ConnStr1", strConn))
ConfigurationManager.RefreshSection("ConnectionStrings") 

D ConfigurationManager.ConnectionStrings.Add(
New ConnectionStringSettings("ConnStr1", strConn))
Dim myConfig As Configuration = _
ConfigurationManager.OpenExeConfiguration( _
ConfigurationUserLevel.None)
myConfig.Save() 

+ Answer
+ Report
Total Preview: 876

Copyright © 2024. Powered by Intellect Software Ltd