Hi All,
I am new in vb.net. I am using Visual Studio 2003 and sql 2000.
I want to use configuration manager to retrive the connection from app.config
But I am getting error " Name 'ConfigurationManager' is not declared"
the code, I written, is as follows:
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Configuration.ConfigurationSettings
-----------------------------------------------------------------
Namespace PC
Public Class DataEntry
Inherits System.Windows.Forms.Form
Public Shared Function GetConnectionString(ByVal conName As String) As String
Dim strReturn As New String("")
If Not String.IsNullOrEmpty(conName) Then
strReturn = ConfigurationManager.ConnectionString(conName).ConnectionString
Else
strReturn = ConfigurationManager.ConnectionString("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=ACCOUNTS;Data Source=winxp").ConnectionString
End If
Return strReturn
End Function
Please help me out...