Answer the question
In order to leave comments, you need to log in
How it is possible to transfer the table to the server?
Hello!
I had an application with a form that had the ability to pull a table from a database using this code:
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 = '{LoginField.Text}' OR Poluchatel = '{LoginField.Text}'", 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
Sending an entire table, especially if it is large, is a sign of an incorrect application architecture.
Data should be sent as the need arises.
The interaction algorithm can be as follows:
1. The application sends (GET or POST) a request to the server;
2. The server processes the incoming request, requests information from the database, converts it, for example, to json, and sends it back;
3. The application receives json, converts it into a class and performs the necessary further actions (displays or processes the received data).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question