TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
yan cus
NA
124
2.9k
How to save and clean a specific database if there are 2 or more data?
Jan 9 2021 3:57 AM
How to save and clean a specific database if there are 2 or more data models in one database file.
previously I have created a data model as below. I have successfully loaded the data into a listView for the public class student.
Then, how do you access data from a public class school that is only input once without using a listView and PrimaryKey?
using
SQLite;
using
System;
namespace
SchoolData.Models {
public
class
Student {
[PrimaryKey, AutoIncrement]
public
int
IdSis {
get
;
set
;
}
public
DateTime Date {
get
;
set
;
}
public
string
PicStudent {
get
;
set
;
}
}
public
class
School {
public
string
SchoolName {
get
;
set
;
}
//without primary key or single entry
public
string
Address {
get
;
set
;
}
public
string
Vision {
get
;
set
;
}
}
}
XamlPage code overview:
<StackLayout>
<Label Text=
"School Name:"
/>
<Entry Text=
"{Binding SchoolName}"
/>
<Label Text=
"Address:"
/>
<Entry Text=
"{Binding Address}"
/>
<Label Text=
"Vision:"
/>
<Entry Text=
"{Binding Vision}"
/>
<Button Text=
"Save"
Clicked=
"SaveClick"
/>
//save all entry
<Button Text=
"Clear"
Clicked=
"ClearClick"
/>
//clear all entry
</StackLayout>
Thank's.
Reply
Answers (
6
)
Xamarin, Bindable Property
WordProcessingML