1,105,633 Community Members

Dataset and Connectionstring Problem

Member Avatar
b1izzard
Junior Poster
118 posts since Jun 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 14 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi all, I got this
Error Message while I try to preview the records in Dataset Designer:

"The connection string could not be found or Data provider associated with the connection string could not be loaded"

Here is my dataset.xsd code

<Connections>
          <Connection AppSettingsObjectName="MySettings" AppSettingsPropertyName="loginConnectionString1" IsAppSettingsProperty="true" Modifier="Assembly" Name="loginConnectionString1 (MySettings)" PropertyReference="ApplicationSettings.PAPv1._0.My.MySettings.GlobalReference.Default.loginConnectionString1" Provider="System.Data.OleDb" />
        </Connections>

I tried my best to solve the problem by Removing the duplicate connection strings in my dataset but it does not works.

Another Error "Object Reference not set to an instance of an Object" arises when I try to change the Connection string.

Here is app.config code

<connectionStrings>
        <add name="PAPv1._0.My.MySettings.loginConnectionString1" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Resources\login.mdb;Persist Security Info=True"
            providerName="System.Data.OleDb" />
    </connectionStrings>
#here I added providerName manually

Please Help:confused:

Member Avatar
finito
Nearly a Posting Virtuoso
1,264 posts since May 2010
Reputation Points: 46 [?]
Q&As Helped to Solve: 140 [?]
Skill Endorsements: 0 [?]
 
0
 

"Object Reference not set to an instance of an Object"

This usually means no result from the Database, Like the connection is OK but there is no matching criteria.

Can you point out where it shows this error, I mean what Line.

Member Avatar
b1izzard
Junior Poster
118 posts since Jun 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 14 [?]
Skill Endorsements: 0 [?]
 
0
 

Can you point out where it shows this error, I mean what Line.

In Solution Explorer Goto Properties->Settings ->
Name:loginconnectionString1
Type: connectionstring
scope:Application
Value: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Resources\login.mdb;Persist Security Info=True"

When I try to Change the Value I get the error Message "Object Reference not set to an instance of an Object"

Member Avatar
finito
Nearly a Posting Virtuoso
1,264 posts since May 2010
Reputation Points: 46 [?]
Q&As Helped to Solve: 140 [?]
Skill Endorsements: 0 [?]
 
0
 

OK, let me get this straight, Is there a DB in "|DataDirectory|\Resources\login.mdb"?

Did this ever work?

What do you change it to?

Try Adding a new DB and then Delete the Old one (Data-> Show/Add Data Sources.)

Member Avatar
b1izzard
Junior Poster
118 posts since Jun 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 14 [?]
Skill Endorsements: 0 [?]
 
0
 

OK, let me get this straight, Is there a DB in "|DataDirectory|\Resources\login.mdb"?

Did this ever work?

What do you change it to?

Try Adding a new DB and then Delete the Old one (Data-> Show/Add Data Sources.)

Yes there is a DB in "|DataDirectory|\Resources\login.mdb" and it works fine prior to the failure. Even now I can Add,Edit records at runtime. My Dataset(loginDataset.xsd) has five Data tables in it,I want to add an new Datatable to the Dataset.

When I try to add a new DB connection using Server Explore:
connection String:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Resources\login.mdb;Persist Security Info=True"
I got the following error:

'Format of the initialization string does not conform to specification starting at index 0.

I have 5 backups of my project at different time interval all are showing the same error and I had created a new Sample Project and there also the same error prevails. I had reinstalled VS2008 but its also in Vain.:S

Member Avatar
b1izzard
Junior Poster
118 posts since Jun 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 14 [?]
Skill Endorsements: 0 [?]
 
0
 

@finito Thanks for your replies. My problem is same as in the following post:

http://www.ureader.com/msg/15365517.aspx

And the solution found in the above forum works fine.
Solution:

'At C: command prompt type in    regsvr32 query.dll   and press enter.

Thanks all :)

Question Answered as of 3 Years Ago by finito
Member Avatar
finito
Nearly a Posting Virtuoso
1,264 posts since May 2010
Reputation Points: 46 [?]
Q&As Helped to Solve: 140 [?]
Skill Endorsements: 0 [?]
 
0
 

Glad to hear that you solved it.

And thanks for posting your solution it will certainly help someone else.
:)

Member Avatar
MaKhalid
Newbie Poster
1 post since Sep 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: