A
A
Andrey Fomin2021-01-09 16:52:28
SQLite
Andrey Fomin, 2021-01-09 16:52:28

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]; 
        }

Here is the database:
5ff9b151742ee887731234.jpeg
And here is the result of the code:
5ff9b4522dbac003892222.png
And it turns out that not all records from the database are displayed on the form. How to remake the SQL query so that all records from the database are displayed?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question