Bug 59795 - Cannot use SqliteDataAdapter in Xamarin iOS
Summary: Cannot use SqliteDataAdapter in Xamarin iOS
Status: RESOLVED INVALID
Alias: None
Product: iOS
Classification: Xamarin
Component: Mono runtime / AOT compiler ()
Version: XI 11.4 (d15-5)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2017-09-27 16:46 UTC by Cameron
Modified: 2017-09-27 16:52 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Cameron 2017-09-27 16:46:00 UTC
I cannot use the sqlitedatadapter in Xamarin iOS.  Thye same exact code work in a windows application when using Mono.Data.Sqlite.


private void updateData()
        {
            string dbCmdText = "SELECT * FROM TICKETS";
            using (SqliteDataAdapter adapter = new SqliteDataAdapter(dbCmdText, connectionString))
            {
                var builder = new SqliteCommandBuilder();
                builder.DataAdapter = adapter;
                
                builder.ConflictOption = ConflictOption.OverwriteChanges;
                adapter.Update(dataTable);
            }
        }
Comment 1 John Miller [MSFT] 2017-09-27 16:52:28 UTC
Hi Cameron,

Make sure you add a reference to Mono.Data.Sqlite and System.Data in the iOS Project. You can do Reference > Edit References and select these libraries. Then, make sure to have the following: 

using Mono.Data.Sqlite;
using System.Data;