Bug 26325 - XA throws a System.InvalidOperationException when creating SQLite database files
Summary: XA throws a System.InvalidOperationException when creating SQLite database files
Status: RESOLVED ANSWERED
Alias: None
Product: Class Libraries
Classification: Mono
Component: Mono.Data.Sqlite ()
Version: master
Hardware: PC Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Marek Habersack
URL:
Depends on:
Blocks:
 
Reported: 2015-01-23 02:37 UTC by Prashant Cholachagudda
Modified: 2018-03-13 16:20 UTC (History)
5 users (show)

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


Attachments
Test case (32.17 KB, application/zip)
2015-01-23 02:37 UTC, Prashant Cholachagudda
Details


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 GitHub or Developer Community 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 ANSWERED

Description Prashant Cholachagudda 2015-01-23 02:37:26 UTC
Created attachment 9461 [details]
Test case

XA throws a System.InvalidOperationException when creating SQLite database files.

## Stacktrace

System.InvalidOperationException: Dynamic SQL generation is not supported with no base table.
  at System.Data.Common.DbCommandBuilder.BuildInformation (System.Data.DataTable schemaTable) [0x00000] in <filename unknown>:0
  at System.Data.Common.DbCommandBuilder.BuildCache (Boolean closeConnection) [0x00000] in <filename unknown>:0
  at System.Data.Common.DbCommandBuilder.GetUpdateCommand (Boolean useColumnsForParameterNames) [0x00000] in <filename unknown>:0
  at System.Data.Common.DbCommandBuilder.GetUpdateCommand () [0x00000] in <filename unknown>:0
  at System.Data.Common.DbCommandBuilder.RowUpdatingHandler (System.Data.Common.RowUpdatingEventArgs rowUpdatingEvent) [0x00000] in <filename unknown>:0

Possible duplicate of #4187
Comment 2 Rajneesh Kumar 2015-01-23 03:37:27 UTC
I have checked this issue and able to reproduce this. To reproduce this issue I have followed  the steps mentioned below:

1. Open attached test case in XS.
2. Build, and deploy it on emulator.
3. It will deploy successfully.
4. Click on button.
5. Observe the following exception:

"System.InvalidOperationException: Dynamic SQL generation is not supported with no base table."

Screencast: http://www.screencast.com/t/56peclMBNL
Exception Details: https://gist.github.com/Rajneesh360Logica/6ba6a78a7c21f8ae4a14
Application Output: https://gist.github.com/Rajneesh360Logica/1106accc036bf701f9c2
Build Output: https://gist.github.com/Rajneesh360Logica/0162f29264e337539347
Ide Logs: https://gist.github.com/Rajneesh360Logica/f96b76784c44963fd927
Android Tools Logs: https://gist.github.com/Rajneesh360Logica/d9cb34c55d43489f6ad7
Device Logs: https://gist.github.com/Rajneesh360Logica/06b45935041304580b25

Environment Info:

=== Xamarin Studio ===

Version 5.7.1 (build 14)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.iOS ===

Version: 8.6.1.19 (Business Edition)
Hash: 80971a6
Branch: 
Build date: 2015-01-21 17:42:51-0500

=== Xamarin.Mac ===

Version: 1.12.0.4 (Business Edition)

=== Build Information ===

Release ID: 507010014
Git revision: a4dd61ad7f8b3695be4b17bcb5c3ae6b81438cf7
Build date: 2015-01-19 15:21:09-05
Xamarin addins: 081208fe3bbf40e24a562867c6c7fba20a9b94b6

=== Operating System ===

Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 3 Jonathan Pryor 2015-01-23 09:18:04 UTC
This is a Mono.Data.Sqlite issue which reproduces in a console app:

1. Download and extract Attachment #26325.
2. Edit SQLErrorSample/SQLErrorSample/Global.cs.
2.a: Rename Test() to Main()
3. Compile:

$ mcs Global.cs -r:Mono.Data.Sqlite -r:System.Data

4. Run:

> $ mono --debug Global.exe 
> 
> Unhandled Exception:
> System.InvalidOperationException: Dynamic SQL generation is not supported with no base table.
>   at System.Data.Common.DbCommandBuilder.BuildInformation (System.Data.DataTable schemaTable) [0x000fb] in /private/tmp/source-mono-mac-3.12.0-branch-32/bockbuild-mono-3.12.0-branch/profiles/mono-mac-xamarin/build-root/mono-3.12.0/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs:132 
>   at System.Data.Common.DbCommandBuilder.BuildCache (Boolean closeConnection) [0x0007b] in /private/tmp/source-mono-mac-3.12.0-branch-32/bockbuild-mono-3.12.0-branch/profiles/mono-mac-xamarin/build-root/mono-3.12.0/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs:91 
>   at System.Data.Common.DbCommandBuilder.GetUpdateCommand (Boolean useColumnsForParameterNames) [0x00000] in /private/tmp/source-mono-mac-3.12.0-branch-32/bockbuild-mono-3.12.0-branch/profiles/mono-mac-xamarin/build-root/mono-3.12.0/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs:601 
>   at System.Data.Common.DbCommandBuilder.GetUpdateCommand () [0x00000] in /private/tmp/source-mono-mac-3.12.0-branch-32/bockbuild-mono-3.12.0-branch/profiles/mono-mac-xamarin/build-root/mono-3.12.0/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs:596 
>   at System.Data.Common.DbCommandBuilder.RowUpdatingHandler (System.Data.Common.RowUpdatingEventArgs rowUpdatingEvent) [0x00045] in /private/tmp/source-mono-mac-3.12.0-branch-32/bockbuild-mono-3.12.0-branch/profiles/mono-mac-xamarin/build-root/mono-3.12.0/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs:660
Comment 4 Marek Safar 2018-03-13 16:20:08 UTC
Please use https://github.com/praeclarum/sqlite-net instead