本文介紹了如何使用monotouch以編程方式在sqlite中創(chuàng)建數(shù)據(jù)庫和表?的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
限時(shí)送ChatGPT賬號..
任何機(jī)構(gòu)都可以幫助我,如何使用monotouch在sqlite中以編程方式創(chuàng)建簡單的數(shù)據(jù)庫和表并插入值,一步一步的過程.我是這項(xiàng)技術(shù)的新手.謝謝..
Can any body help me about, how to create simple database and tables programatically and insert values ,step by step procedure in sqlite using monotouch.I am new to this technology . Thank you..
推薦答案
如果您使用的是 sqlite-net(我強(qiáng)烈推薦)你可以簡單地調(diào)用:
If you're using sqlite-net (which I highly recommend) you can simply call:
public class Stock
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
[MaxLength(8)]
public string Symbol { get; set; }
}
創(chuàng)建
var db = new SQLiteConnection("stocks.db");
db.CreateTable<Stock>();
插入
var s = db.Insert(new Stock() {
Symbol = symbol });
查詢
return db.Query("select * from Valuation where StockId = ?", stock.Id);
Query
return db.Query ("select * from Valuation where StockId = ?", stock.Id);
這篇關(guān)于如何使用monotouch以編程方式在sqlite中創(chuàng)建數(shù)據(jù)庫和表?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!