0
我有以下几点:平板设备内部如何插入和使用的SQLite SQLite的更新净
tblCustomer ID CompanyName Group Product group GST -- ----------- ------- ------------- ---- 1 The One Exp A 4 2 The One Exp A 8 . . 20
2)SQLite的-DB:在后端服务器
1)的SQL Server。
tblCustomer ID CompanyName Group Product group GST -- ----------- ------- ------------- ---- 1 The One Exp A 4 2 The One Exp A 8 . The One . 20 The One
3) 我使用Web服务从服务器获取数据,并使用下面的代码
The Problems: 1). How to I update the tblCustomer in SQLite for changes below: Note: ID in SQL sever and Sqlite ARE not the same. ID CompanyName Group Product group GST -- ----------- ------- ------------- ---- 1 The One Exp A 6 < -- before it was 4 2) Someone add data in SQL Server and the total record is 21 now. How to add this record in SQLite tbl customer? foreach (var client in Customers) { InsertNewCustomer(client.Company, client.Group, client.ProductGroup, client.GST) } private void InsertNewCustomer(string Company,string Grp, string PGrp, int Gst) { 1) How to create SQL Statement for this case? var existingCustomer = (db2.Table<Customer>().Where(c => c.No == Company)) ??? if (existingCustomer != null) { ??-- how to handle? int success = db2.Update(existingCustomer); } else { int success = db2.Insert(new Customer() { Name = Company, Group = Grp, ProductGroup = PGrp, GST = Gst }); } }
在SQL服务器和SQLite中的ID是不一样的。你能用SQLITE-Net的方法展示我吗? – MilkBottle