0

DATE が から来るテーブルからすべてのデータを選択したいと思いますDateTimePicker

これは私がこれまでに持っているコードです:

MySqlConnection connection = new MySqlConnection(MyConnection);
connection.Open();
MySqlCommand cmd = connection.CreateCommand();
cmd.CommandText = "SELECT * FROM income_table WHERE income_date='" + 
                   dateShower.Value + "';";
cmd.Connection = connection;
MySqlDataReader myDataReader = cmd.ExecuteReader();
while (myDataReader.Read())
{
    txtIncomeList.Text = Convert.ToString(myDataReader["income_subcategory"] + 
                           "\t\t" + myDataReader["income_amount"] + "\r\n" +
                           myDataReader["income_vendor"]+ "\t\t" + 
                           myDataReader["income_paidby"]+"\r\n\r\n");
}
4

1 に答える 1