简体   繁体   English

HTML 从本地 SQL 文件加载数据

[英]HTML load Data from a local SQL file

I made a simple iOS App with Xamarin with a WebView to load local HTML code and run it.我使用 Xamarin 和 WebView 制作了一个简单的 iOS 应用程序来加载本地 HTML 代码并运行它。 Now i want to add a local SQL file and generate a HTML table from its data.现在我想添加一个本地 SQL 文件并从它的数据生成一个 HTML 表。 It should run on an iPad without Internet Connection.它应该在没有 Internet 连接的 iPad 上运行。 How can i connect my .html with a local database, so i can create a table from its data?如何将我的 .html 与本地数据库连接,以便我可以从其数据创建一个表?

First of all are using Xamarin.Forms or Xamarin.iOS?首先是使用 Xamarin.Forms 还是 Xamarin.iOS?

This links will help to add SQL database to your app: Forms , iOS .此链接将有助于将 SQL 数据库添加到您的应用程序: FormsiOS

To connect your .html with a database data use MVVM .要将 .html 与数据库数据连接,请使用MVVM Read DB data in your model, then in view create html code and use LoadHtmlString to load it to web view.读取模型中的 DB 数据,然后在视图中创建 html 代码并使用LoadHtmlString将其加载到 Web 视图。

PS Please improve your question and add your WebView code in order to help you in more efficient way. PS 请改进您的问题并添加您的 WebView 代码,以便以更有效的方式帮助您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM