Answer the question
In order to leave comments, you need to log in
How to send a SQL query?
Hello!
There is a database and a form with a button, when clicked, the following code is executed:
private void button1_Click(object sender, EventArgs e)
{
SQLiteConnection conn = new SQLiteConnection("Data source = accounts.db");
conn.Open();
SQLiteDataAdapter dataAdapter = new SQLiteDataAdapter($"SELECT * FROM PaymentHistory WHERE Otpravitel OR Poluchatel = '{LoginField.Text}' GROUP BY Vremya", conn);
DataSet ds = new DataSet();
dataAdapter.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question