Click here to Skip to main content
12,452,106 members (57,551 online)
Rate this:
 
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
        Try
 

24:         con.Close()
            If con.State = ConnectionState.Closed Or con.State = ConnectionState.Broken Then
                con.Open()
            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
CPallini387.9K
v2

1 solution

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

Solution 1

It looks you forgot a Import System.Configuration statement.
  Permalink  
Comments
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 | Mobile
Web01 | 2.8.160826.1 | Last Updated 29 Aug 2012
Copyright © CodeProject, 1999-2016
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