Click here to Skip to main content
13,093,097 members (56,181 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Imports Microsoft.VisualBasic
Imports System.Data
Imports System.Data.SqlClient
Public Class query
    Dim str As String
    Dim cmd As SqlCommand
    Dim dr As SqlDataReader
    Dim con As System.Data.SqlClient.SqlConnection = New System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("cn").ConnectionString)
    Dim da As SqlDataAdapter
    Dim ds As DataSet
    Dim dt As DataTable

 Function read(ByVal str As String) As SqlDataReader

24:         con.Close()
            If con.State = ConnectionState.Closed Or con.State = ConnectionState.Broken Then
            End If
            cmd = New SqlCommand(str, con)
            dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)

            Return dr
        Catch ex As Exception
            If Left(ex.Message, 20) = "The ConnectionString" Then
                con = New System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("cn").ConnectionString)
                GoTo 24
            End If
            Return dr
        End Try

    End Function
End Class

When I Compile This File To .dll File It Shows Error

Name 'Configuration Manager' Is Not Declared.Please Help
Posted 28-Aug-12 23:29pm
Updated 28-Aug-12 23:38pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

It looks you forgot a Import System.Configuration statement.
kishore doni 29-Aug-12 6:10am
yes its true

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 29 Aug 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100