Click here to Skip to main content
Rate this: bad
good
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
Edited 28-Aug-12 23:38pm
CPallini319.6K
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 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)

  Print Answers RSS
0 OriginalGriff 6,656
1 Sergey Alexandrovich Kryukov 6,400
2 CPallini 5,240
3 George Jonsson 3,584
4 Gihan Liyanage 2,625


Advertise | Privacy | Mobile
Web02 | 2.8.140921.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