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

Microsoft.Data.Sqlite: No SqliteDataAdapter #13838

Open
Tracked by #22949
faib920 opened this issue May 18, 2018 · 8 comments
Open
Tracked by #22949

Microsoft.Data.Sqlite: No SqliteDataAdapter #13838

faib920 opened this issue May 18, 2018 · 8 comments

Comments

@faib920
Copy link

faib920 commented May 18, 2018

No SqliteDataAdapter is inconvenient to batch update data.

@Perksey
Copy link
Member

Perksey commented Jun 3, 2018

I made a custom one for Beagle Framework, the entirety of it is found here: https://github.com/aspnet/Microsoft.Data.Sqlite/issues/523#issue-328782809

@Perksey
Copy link
Member

Perksey commented Jun 3, 2018

Also, I believe this has been requested many times before, but the developers passed it as "old-fashioned".

So this is a duplicate of #455, read up on the conversation on there.

@bricelam
Copy link
Contributor

bricelam commented Jun 4, 2018

@DylanFPS So there's actually no code for generating DML? If that's the case, we may be more open to accepting a PR...

@Perksey
Copy link
Member

Perksey commented Jun 9, 2018

@bricelam A code snippet wouldn't make sense out of context, so here is the file that generates commands:
https://hub.ultz.co.uk/code/projects/BF/repos/beagle/browse/Ultz.BeagleFramework/Sql/SqlTable.Commands.cs

In that repo, the Ultz.BeagleFramework.Sqlite project is the SQLite implementation.

@Perksey
Copy link
Member

Perksey commented Jun 9, 2018

The SqliteDataAdapter works as expected, however its the dynamic type system that really messes up DataTables. Once there's a solution for this, I might PR.

@bnuzhouwei
Copy link

Why this issue goes so slow, CreateDataadapter method return null, that lead cann't upgrade the net48 app to net6, so sad

@coredreamsolutions
Copy link

Does your fix work on .NET 6? I had to go back to System.Data.Sqlite which surprisingly now works in .NET 6.

@pmcfernandes
Copy link

pmcfernandes commented Jun 26, 2023

Try this:

SqliteCommand cmd = (SqliteCommand)SqliteFactory.Instance.CreateCommand();
cmd.CommandText = strSQL;
cmd.Connection = conn;

DataTable dt;

using (SqliteDataReader dr = cmd.ExecuteReader())
{
     do
     {
                dt = new DataTable();
                dt.BeginLoadData();
                dt.Load(dr);
                dt.EndLoadData();

     } while (!dr.IsClosed && dr.NextResult());
}

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

7 participants