I got a datgridview. I add 1 more column to get difference of Meter 2 and meter 1.

private void Loads()
        {
            ConnectionStringSettings conSettings = ConfigurationManager.ConnectionStrings["MyDBConnectionString"];
            string name = conSettings.ProviderName;
            string providerName = conSettings.ProviderName;
            string ConnectionString = conSettings.ConnectionString;

            string sql = "SELECT * FROM WaterRecord Order by RecordID DESC";

            SqlConnection connection = new SqlConnection(ConnectionString);
            connection.Open();
            sCommand = new SqlCommand(sql, connection);

            sAdapter = new SqlDataAdapter(sCommand);
            sBuilder = new SqlCommandBuilder(sAdapter);
            sDs = new DataSet();
            sAdapter.Fill(sDs, "WaterRecord");
            sTable = sDs.Tables["WaterRecord"];
            connection.Close();

            dataGridView1.DataSource = sDs.Tables["WaterRecord"];
            dataGridView1.ReadOnly = true;

            dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            txtNote.Text = "";
        }

Is there a question in there that I'm missing?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.