Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating PetaPoco.Database with SqlConnection #136

Closed
rickelprior opened this issue Sep 24, 2012 · 5 comments
Closed

Creating PetaPoco.Database with SqlConnection #136

rickelprior opened this issue Sep 24, 2012 · 5 comments

Comments

@rickelprior
Copy link

I tried to use PetaPoco this way :

        using (var connection = new SqlConnection(MyConnectionString))
        {
            connection.Open();
            IEnumerable<Person> personList = (new PetaPoco.Database(connection)).Fetch<Person>(MySqlSelect);
            return persons;
        }

And I get a System.NullReferenceException in PetaPoco.Resolve method (because ProviderName is null).

But it works if in PetaPoco.Resolve method you replace this line :

        if (TypeName.StartsWith("System.Data.SqlClient."))

by this one :

        if (TypeName.StartsWith("SqlConnection"))

because TypeName is a IDBConnection.Name and not a IDBConnection.FullName.

@edwinvankoppen
Copy link

Got the same problem!

@cravelight
Copy link

Same issue.

@OnamChilwan
Copy link

Same issue here!

@drmcclelland
Copy link

Yep, same issue here...

@pleb
Copy link
Member

pleb commented Dec 5, 2015

I'm sorry that your issue has been left for so long. In an effort to reboot PetaPoco your issue has been closed. If you think this is still a problem. Please feel free to open and another issue. Please pass the word on that PetaPoco is back. We're looking for people #204.

@pleb pleb closed this as completed Dec 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants