Help is needed. How do I print the entire table from DGV? I parse information from the database in this way:

private void LoadData() { string connectString = "datasource=localhost;port=3306;Initial Catalog= 'Rebel';username=root;password="; MySqlConnection myConnection = new MySqlConnection(connectString); myConnection.Open(); string query = "SELECT * FROM `Товары`"; MySqlCommand command = new MySqlCommand(query, myConnection); MySqlDataReader reader = command.ExecuteReader(); List<string[]> data = new List<string[]>(); while (reader.Read()) { data.Add(new string[4]); data[data.Count - 1][0] = reader[0].ToString(); data[data.Count - 1][1] = reader[1].ToString(); data[data.Count - 1][2] = reader[2].ToString(); data[data.Count - 1][3] = reader[3].ToString(); } reader.Close(); myConnection.Close(); foreach (string[] s in data) dataGridView1.Rows.Add(s); } 

After Parsa, I need to print it, I found in the search for printing a table, but it is not complete and distorted. Maybe there is some export in Exel or Word? thanks in advance

  • one
    The first index on google is stackoverflow.com/questions/15853746/… - Kirill Runk
  • @ Kirill'luridSNK'F. on what request? According to the Russian-speaking clearly this does not find - yolosora
  • @yolosora do not want to seem arrogant (really not the first index), but you (still) didn’t look well :) There is also a link to msdn Anyway, who will look for programming information in Russian (I mean the search itself, not its result)? - Kirill Runk
  • @ Kirill'luridSNK'F. Obviously, a person does not speak English - yolosora

0