Answer the question
In order to leave comments, you need to log in
Extracting data from sqlite c#?
There is a c# project with a connected database. The database contains 1 table with 4 columns: Name, Gender, Age, City. On the form I have a ListBox in which I extract the names of all people from the database. It is necessary for me that at a choice of any name in ListBox about this person the information (a floor, age, a city) was deduced.
void getData()
{
SQLiteConnection connection = new SQLiteConnection(string.Format("Data Source={0};", base));
connection.Open();
SQLiteCommand command = new SQLiteCommand("SELECT * FROM 'peoples';", connection);
SQLiteDataReader people = command.ExecuteReader();
while (people.Read())
{
object getname = people[0];
listBox1.Items.Add(getname);
}
connection.Close();
}
Answer the question
In order to leave comments, you need to log in
"SELECT * FROM 'peoples';"
look towards DbFacadeSQLite - a very handy library, I've been using it for a long time clip2net.com/s/3nU9eKo
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question