Click here to Skip to main content
15,902,917 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questiontextbox suggest Pin
wajans25-Jul-08 10:06
wajans25-Jul-08 10:06 
QuestionHL7 Integration Pin
Aslesh25-Jul-08 8:20
Aslesh25-Jul-08 8:20 
QuestionWebservices in C#.net Pin
balu1234525-Jul-08 8:02
balu1234525-Jul-08 8:02 
AnswerRe: Webservices in C#.net Pin
SomeGuyThatIsMe25-Jul-08 8:32
SomeGuyThatIsMe25-Jul-08 8:32 
GeneralRe: Webservices in C#.net Pin
Ashfield25-Jul-08 8:35
Ashfield25-Jul-08 8:35 
GeneralRe: Webservices in C#.net Pin
SomeGuyThatIsMe25-Jul-08 8:39
SomeGuyThatIsMe25-Jul-08 8:39 
GeneralRe: Webservices in C#.net Pin
Blue_Boy25-Jul-08 12:09
Blue_Boy25-Jul-08 12:09 
QuestionOleDB connection.Open() fails in WebService only Pin
ErikJL25-Jul-08 5:03
ErikJL25-Jul-08 5:03 
I have a simple ASP webservice that performs a SELECT query against a database, and then an INSERT statement on the same database/table. The problem arises at the time when we create the second OleDB connection object and attempt to Open() it. The connection string is exactly the same for both connection objects. Another intersting thing is that this code works fine when it is used in a Windows Form project. I'm using VS2003.

Here's the code used for both attempts:

try
{
cnOleDBSDE = new OleDbConnection();
 
cnOleDBSDE.ConnectionString = "Data Provider=" +DBProvider+ ";"+
   "Provider=" + DBShapeProvider + ";" +
   "Data Source=" + DBName + ";" +
   "Pooling=" + Pooling.ToString() + ";" +
   "User Id=" + UserId + ";" +
   "Password=" + Password;
cnOleDBSDE.Open();
}



Here's the connection object data from the immediate window when .Open() is called succesfully:

cnOleDBSDE
{System.Data.OleDb.OleDbConnection}
base {System.Data.Common.DbConnection}: {System.Data.OleDb.OleDbConnection}
ConnectionString: "Data Provider=MSDAORA.1;Provider=MSDataShape;Data Source=sdeprod;Pooling=False;User Id=ACOUSINS;Password=djhf6li"
ConnectionTimeout: 15
Database: ""
DataSource: "sdeprod"
Provider: "MSDataShape"
ServerVersion: 'cnOleDBSDE.ServerVersion' threw an exception of type 'System.InvalidOperationException'
State: Closed


And the connection object data from the immediate window when .Open() throws an OleDB exception:

cnOleDBSDE 
{System.Data.OleDb.OleDbConnection}
base {System.Data.Common.DbConnection}: {System.Data.OleDb.OleDbConnection}
ConnectionString: "Data Provider=MSDAORA.1;Provider=MSDataShape;Data Source=sdeprod;Pooling=False;User Id=ACOUSINS;Password=djhf6li"
ConnectionTimeout: 15
Database: ""
DataSource: "sdeprod"
Provider: "MSDataShape"
ServerVersion: 'cnOleDBSDE.ServerVersion' threw an exception of type 'System.InvalidOperationException'
State: Closed


I don't see any differences. Finally here's the error:

{"Data provider could not be initialized."}
    [System.Data.OleDb.OleDbException]: {"Data provider could not be initialized."}
    Data: {System.Collections.ListDictionaryInternal}
    HelpLink: null
    InnerException: null
    Message: "Data provider could not be initialized."
    Source: "MSDataShape"
    StackTrace: "   at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)\r\n   at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)\r\n   at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)\r\n   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)\r\n   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)\r\n   at System.Data.OleDb.OleDbConnection.Open()\r\n   at GDAC.GDAC.OpenOleDbConnection(String DBName, String DBProvider, String DBShapeProvider, Boolean Pooling, String UserId, String Password) in D:\\ETS\\GDAC\\GDAC.cs:line 471"
    TargetSite: {Void .ctor(System.Data.OleDb.OleDbConnectionString, System.Data.OleDb.OleDbConnection)}



_HResult -2147168229 int

I tried Googling and found people with similar issues from years ago, but no resolutions. Any ideas?
AnswerRe: OleDB connection.Open() fails in WebService only Pin
Mike Ellison25-Jul-08 6:02
Mike Ellison25-Jul-08 6:02 
GeneralRe: OleDB connection.Open() fails in WebService only Pin
ErikJL25-Jul-08 6:56
ErikJL25-Jul-08 6:56 
QuestionApplication Alerts Pin
C. L. Phillip25-Jul-08 4:44
C. L. Phillip25-Jul-08 4:44 
AnswerRe: Application Alerts Pin
SomeGuyThatIsMe25-Jul-08 5:57
SomeGuyThatIsMe25-Jul-08 5:57 
AnswerRe: Application Alerts Pin
Mike Ellison25-Jul-08 5:58
Mike Ellison25-Jul-08 5:58 
AnswerRe: Application Alerts Pin
C. L. Phillip25-Jul-08 9:49
C. L. Phillip25-Jul-08 9:49 
QuestionActive X controls Pin
Dot Net rookie25-Jul-08 3:22
Dot Net rookie25-Jul-08 3:22 
AnswerRe: Active X controls Pin
ToddHileHoffer25-Jul-08 3:57
ToddHileHoffer25-Jul-08 3:57 
GeneralRe: Active X controls Pin
Dot Net rookie25-Jul-08 4:02
Dot Net rookie25-Jul-08 4:02 
GeneralRe: Active X controls Pin
ToddHileHoffer25-Jul-08 4:32
ToddHileHoffer25-Jul-08 4:32 
GeneralRe: Active X controls Pin
Dot Net rookie25-Jul-08 4:43
Dot Net rookie25-Jul-08 4:43 
QuestionIIS 6.0 Virtual Directory Pin
Civic0625-Jul-08 3:10
Civic0625-Jul-08 3:10 
AnswerRe: IIS 6.0 Virtual Directory Pin
Sherin Iranimose25-Jul-08 3:56
Sherin Iranimose25-Jul-08 3:56 
AnswerRe: IIS 6.0 Virtual Directory Pin
Sunil Wise25-Jul-08 4:05
professionalSunil Wise25-Jul-08 4:05 
GeneralRe: IIS 6.0 Virtual Directory [modified] Pin
Civic0625-Jul-08 4:44
Civic0625-Jul-08 4:44 
GeneralRe: IIS 6.0 Virtual Directory Pin
Sunil Wise25-Jul-08 18:53
professionalSunil Wise25-Jul-08 18:53 
QuestionHow to keep Gridview Header and first row fix and other row keep vertical scrolling Pin
jaganil25-Jul-08 2:10
jaganil25-Jul-08 2:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.