Ciao questo è il mio Web.ConfigOriginariamente inviato da SPEED78
ragazzi ma dove sbaglio??? sti impazzendo posto il codice grazie a todos
web config :codice:Dim objConn = ConfigurationManager.ConnectionStrings("connectionstring").ConnectionString Dim sql As String = "select * from t_capisaldi" Dim objCmd As New OleDbCommand(sql, objConn)
errorecodice:<configuration> <appSettings/> <connectionStrings> <add name="connectionstring" connectionString="Data Source=ROAD-SERVER1;Initial Catalog=ANAS_milano;User ID=admin;Password=ripper" providerName="System.Data.SqlClient" /> </connectionStrings>
codice:Unable to cast object of type 'System.String' to type 'System.Data.OleDb.OleDbConnection'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Data.OleDb.OleDbConnection'. Source Error: Line 117: Dim objConn = ConfigurationManager.ConnectionStrings("connectionstring").ConnectionString Line 118: Dim sql As String = "select * from t_capisaldi" Line 119: Dim objCmd As New OleDbCommand(sql, objConn)![]()
![]()
![]()
<appSettings>
<add key="conn" value="Server=(local);Database=zzz;uid=yyy;passwor d=xxx" />
</appSettings>