2017-08-18 60 views
1

我已經從下面的代碼檢索的用戶的列表:插入列表<collection>爲sql精簡版數據庫UWP

var Response1 =JsonConvert.DeserializeObject<List<User>>(jsonstring); 

Public class User 
{ 
public string userid {get; set;} 
public string username{get; set;} 
public string pwd {get; set;} 
} 

是否有任何方式插入響應1(type of List<User>)到現有的源碼用戶表(UWP)除了每種方法之外。

+1

https://stackoverflow.com/questions/36778304/how-to-bulk-insert-into-sqlite-數據庫這裏是你的問題的答案。 –

回答

0

你可以使用SQLiteConnection.InsertAll Method

using (var db = new SQLiteConnection(new SQLitePlatformWinRT(), DbPath)) 
{ 
    db.InsertAll(Response1); 
} 

希望對大家有所幫助:)

+0

非常容易的解決方案。它的工作 –

+0

@SruthiA您的歡迎。所以你可以標記接受的答案:) –