Thanks for your replay.
SQLConnection works on our develop machine.
This problem occurred after a hacker attack on our public server.
After reinstalling the framework, everything seems to be ok, except
SQLConnection.
To track this problem down, I tried to connect with OleDbConnection instead,
and that did work.
Maybe there is a corrupt DLL or something.
I just can't figure out what to do to solve this problem, based on the
"Stack Trace"
--------------------------
The SQLConnection issue commented out...
'conString = ("server=MyServ er;uid=USER;pwd =pass;database= MyDB")
conString = ("Provider=SQLO LEDB;data
source=MyServer ;database=MyDB; uid=USER;pwd=pa ss")
Dim XstrSQL As String = "SELECT * FROM users WHERE User_ID=1"
Dim conO As New OleDb.OleDbConn ection(conStrin g)
Dim conC As New OleDb.OleDbComm and(XstrSQL, conO)
Try
conO.Open()
Dim conDR As OleDb.OleDbData Reader
conDR = conC.ExecuteRea der(CommandBeha vior.CloseConne ction)
While conDR.Read()
Test = conDR("User_Nam e")
End While
Response.Write( Test)
Catch sx As System.IO.FileN otFoundExceptio n
Response.Write( sx.StackTrace & "<br><br>" & sx.Message)
End Try
'Dim XscnnNW As New SqlConnection(c onString)
'Dim Xscmd As New SqlCommand(Xstr SQL, XscnnNW)
'Dim XobjDR As SqlDataReader
'Try
'XscnnNW.Open()
'XobjDR = Xscmd.ExecuteRe ader(CommandBeh avior.CloseConn ection)
'While XobjDR.Read()
'Test = XobjDR("User_Na me")
'End While
'Catch sx As System.IO.FileN otFoundExceptio n
Response.Write( sx.StackTrace & "<br><br>" & sx.Message)
'Finally
'Xscmd.Dispose( )
'XscnnNW.Dispos e()
'End Try
"Patrice" <no****@nowhere .com> skrev i melding
news:O7******** ******@TK2MSFTN GP15.phx.gbl...
Usually it just works ;-)
The few lines surrounding the call raising this exception would help. My
wild wild guess would be a connection string issue.
Patrice
--
"Ludvig" <gj******@fastp ublish.no> a écrit dans le message de
news:0e******** ************@ne ws.telia.no... This Exception is executed when using SQLConnection.
OleDbConnection connects fine.
[FileNotFoundExc eption: The specified module could not be found.]
System.Enterpri seServices.Plat form.Initialize () +503
System.Enterpri seServices.Reso urcePool..ctor( TransactionEndD elegate
cb) +11
System.Data.Sql Client.Connecti onPool..ctor(De faultPoolContro l ctrl)
+797 System.Data.Sql Client.PoolMana ger.FindOrCreat ePool(DefaultPo olControl
ctrl) +170
System.Data.Sql Client.SqlConne ctionPoolManage r.GetPooledConn ection(SqlConne c
tionString options, Boolean& isInTransaction ) +358
System.Data.Sql Client.SqlConne ction.Open() +384
component_net.t est.GetSingleVa lueStringX(Stri ng sTable, String
sFieldToGet, String sFieldToFind, String sValueToFind)
component_net.t est.Page_Load(O bject sender, EventArgs e)
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +35
System.Web.UI.P age.ProcessRequ estMain() +731