ragazzi ma dove sbaglio??? sti impazzendo posto il codice grazie a todos
codice:
Dim objConn = ConfigurationManager.ConnectionStrings("connectionstring").ConnectionString
Dim sql As String = "select * from t_capisaldi"
Dim objCmd As New OleDbCommand(sql, objConn)
web config :
codice:
<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>
errore
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)