I was trying to do the following:
Dim cmd As SqlCommand
Dim objConnection As SqlConnection
objConnection = New SqlConnection = Web.config
where the We.config is where my connection string is set. but I get a sintax error in the Web.config line.
is it possible to asign the value of the web.config content to the new sql connection?
thanks for any suggestions.
Hi, you can use WebConfigurationManager class to get connection string from web.config. Please refer to this article:
http://msdn2.microsoft.com/en-us/library/system.web.configuration.webconfigurationmanager(d=ide).aspx
No comments:
Post a Comment