I have created a SQLite db. It is stored on the C: of my machine.
My application connects to the db ok when running in Local Host. However, when I deploy the Web App to Azure then it fails to connect the database.
I have installed the SQLite Nuget package. I have tested this in local host and it works.
Web Config Connection String:
<connectionStrings>
<add name="Testdb" connectionString="Data Source=C:\TestSQLite\Testdb.db;Version=3;" providerName="System.Data.SqlLite"/>
</connectionStrings>
Web Form Data Source:
<asp:SqlDataSource ID="Testdb" ConnectionString="<%$ ConnectionStrings:Testdb %>" ProviderName="System.Data.SQLite" SelectCommand="select * from BatchNumbers" runat="server">
I expect the web form to display information stored in the SQLite database table 'BatchNumbers'
And here is the Error Message:
[SQLiteException (0xe): unable to open database file]
System.Data.SQLite.SQLite3.Open(String strFilename, String vfsName, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, Int32 maxPoolSize, Boolean usePool) +644
System.Data.SQLite.SQLiteConnection.Open() +5579
HTML5OfflineApplication.BulkCopy_DataTableToSQLLite.Button1_Click(Object sender, EventArgs e) in C:\Users\Me\OneDrive - Me\Visual Studio\source\repos\Offline\Offline\Secure\BulkCopy_DataTableToSQLLite.aspx.cs:32
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +109
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +31
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3470
I have amended the connection string and tried the following:
sql_con = new SQLiteConnection(a, true);
and also
connectionString="Data source=C:\TestSQLite\Testdb.db; Version=3; FailIfMissing=False"
I think my error is in the event args here which references a specific location on my device that isn't accessible to the program:
HTML5OfflineApplication.BulkCopy_DataTableToSQLLite.Button1_Click(Object sender, EventArgs e) in C:\Users\Me\OneDrive - Me\Visual Studio\source\repos\Offline\Offline\Secure\BulkCopy_DataTableToSQLLite.aspx.cs:32
Is it this that is causing the conflict?? Help!! Arggghe enter code here