在這裏,我對存儲過程感到困惑。這裏,我們將所有數據庫相關操作應用到代碼中:我們可以在mvvm中應用存儲過程嗎?用理由解釋
string query = "insert into accounts(name, opening_balance, category, address, contact_person, phone_number) values("
+ "'" + account.Name + "',"
+ account.OpeningBalance + ","
+ account.Category.Id + ","
+ "'" + account.Address + "',"
+ "'" + account.ContactPerson + "',"
+ "'" + account.PhoneNumber + "')";
account.Id = SQLiteHelper.ExecuteInsert(query);
我們可以將它應用於存儲過程嗎?如果是這樣:怎麼樣?存儲過程優於它的優點是什麼?
您的代碼可能有SQL注入漏洞。 –
MVVM和存儲過程是正交的 - 您可以分別使用兩者或每個。 – Oded
@Oded:嘿,你可以看到我的代碼我們正在使用SQLite數據庫。在SQLite商店程序適用? – prjndhi