Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Answers
How to insert multiple records at once in SQLite
Arvind Chourasiya
8y
306
1
Reply
Hii
i want to insert multiple record in my SQLite table at a time. See this line of code
var items = await MgoApi.Get("Assignment/GetAssigstudents", param);
in this line i'm getting multiple record in items from API, now how can i insert items all record in local database table.
i'm using xamarin android, SQLite database with SQLiteAsyncConnection in VS2013
how i have tried see
foreach(var _items in items)
{
obj.Amount = _items.Amount;
obj.Purpose_Of_Spending = _items.Purpose_Of_Spending;
obj.Type = _items.Type;
obj.Subject=_items.Subject;
obj.Rank=_items.Rank
var RowAffted= Repository_obj.Insert(obj);
}
is this way is correct or not, if you people have more efficient way can suggest me. Thank You
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
How to auto increment integer + variable in c#
add one more row on windows form when click on add button c#