Member Avatar for b1izzard

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:

"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 for b1izzard

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"

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 for b1izzard

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 for b1izzard

@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 :)

Glad to hear that you solved it.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.