Answer the question
In order to leave comments, you need to log in
How to store data from a database offline in a Win Forms application?
There is an application on Win Forms in which there is a request to a DB and an output of contents of tables through DataGridView.
private void buttonOK_Click(object sender, EventArgs e)
{
if (СomboBoxTables.SelectedItem == null) return;
adapter = new SqlDataAdapter("SELECT * FROM [" + СomboBoxTables.SelectedItem.ToString() + "]", conn);
new SqlCommandBuilder(adapter);
dtMain = new DataTable();
adapter.Fill(dtMain);
DataGridView1.DataSource = dtMain;
}
Answer the question
In order to leave comments, you need to log in
in exe
no way. if you only save to a separate file - json
, csv
, xml
.. in fact there are many options, at least file your own format
or into a lightweight embeddable database ps popular options are SQLite, MS SQLCE , LiteDB .. in fact there are many options pps even Access - the joke is that it is not Access itself that is primary, but the engine. it is built into any Windows by default. so many generations of ppps
but I don't know how to "copy" these same "pieces" from the common archive base.still look here (unless of course you have MS SQL, which can be assumed from various passages)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question