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

Does not work with OleDbConnection #145

Open
DrViente opened this issue Sep 13, 2022 · 1 comment
Open

Does not work with OleDbConnection #145

DrViente opened this issue Sep 13, 2022 · 1 comment

Comments

@DrViente
Copy link

Good morning everyone.

I figured out that Dapper.Contrib does not support OleDbConnection, that because, for example on the Get function of SqlMapperExtensions.cs do:

var type = typeof(T);

            if (!GetQueries.TryGetValue(type.TypeHandle, out string sql))
            {
                var key = GetSingleKey<T>(nameof(Get));
                var name = GetTableName(type);

                sql = $"select * from {name} where {key.Name} = @id";
                GetQueries[type.TypeHandle] = sql;
            }

            var dynParams = new DynamicParameters();
            dynParams.Add("@id", id);

the "@" notation is not supported on OleDb, for my example I need to operate bot SQL Server and MS Access DB and OleDBConnection is the only way to accomplished both connection

There is a plan to support OleDbConnection "?" notation?

@ghost
Copy link

ghost commented Oct 24, 2022

I just made a pull request fixing just this. Maybe you can try if it works for you aswell?

#148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant