473,606 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OleDbConnection Good, SQLConnection Bad??

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

Nov 18 '05 #1
3 1788
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

Nov 18 '05 #2
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


Nov 18 '05 #3
PJ
After couple of hours assembly language debugging, figured out that it throws
that exception because a call to native Win32 API LoadLibraryW was failing.
The LoadLibraryW was trying to load \WINNT\SYSTEM32 \COM\comadmin.d ll. Once
I copied that DLL from another system, it worked like a charm.

Hope this helps others.

P

"Ludvig" wrote:
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



Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
12516
by: cody | last post by:
What is the difference between OleDBConnection and SqlConnection? Or better expressed, what is OleDB? -- cody www.deutronium.de.vu || www.deutronium.tk
5
13555
by: Tim Bücker | last post by:
Hello. I am trying to get a connection to MySQL using OleDb but it seems that I am making something wrong. I´ve found this source in the net but it doesn´t work for me: System.Data.OleDb.OleDbConnection con; con=new System.Data.OleDb.OleDbConnection(""); con.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test;"; con.Open();
3
2770
by: Shreeram Natarajan | last post by:
Hello, Iam developing a sharepoint webpart which needs to read data from an excel file. Iam using OleDbconnection for reading data from excel. However using OleDbconnection object gives the following error: "Request Failed: System.Security.SecurityException."
1
1960
by: Keith | last post by:
Hi, if have this method in a cs file that connections to a database and returns a datareader to my web form. public OleDbDataReader GetDataReader(string theSQL) { theConn = new OleDbConnection(ConnectionString); theConn.Open(); OleDbCommand cmd = new OleDbCommand(theSQL, theConn);
4
9613
by: Curtis | last post by:
Which is preferred or what is the difference? SQLConnection or OLEDbConnection. We are connecting to data in MSSQL2000 primarily through stored procedures.
1
3695
by: Greg J | last post by:
What is the difference when using SQLConnection and SQLX classes or OleDbConection and OleDbXXX classes for database manipulation in multiuser (e.g. 100 users) environment? Can both handle connection pooling etc. or what might be the reason when selecting from these two DB class categories? Cheers!
1
1729
by: JO | last post by:
hello, is there a difference in speed between OLEDBConnection and SQLConnection bye, ################################################################## bonjour, existe t'il une différence de rapidite entre une connection
16
7191
by: SyGC | last post by:
Hello, Im trying to connect to a MySQL DB on my home network (testing purposes) using the following VB.NET code; Imports System.Data.OleDb Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim SQLConnection As OleDbConnection
2
3869
by: Mark Rae [MVP] | last post by:
"Roger Withnell" <RogerWithnell@discussions.microsoft.comwrote in message news:9579A956-349D-4D23-B253-4175C2D7AE1F@microsoft.com... For ASP.NET you should use a native .NET data provider whenever possible: http://www.connectionstrings.com/?carrier=sqlserver2005 -- Mark Rae
0
7939
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8432
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8428
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8299
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6753
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5456
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2442
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1548
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1285
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.