Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C# VB DLL
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 29-Aug-12 0:29am
Edited 29-Aug-12 0:38am

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 at 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)

Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 29 Aug 2012
Copyright © CodeProject, 1999-2014
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