我有一個問題: 我正在用數據庫連接(acces數據庫)製作日曆應用程序。 有了這個應用程序,人們可以添加約會,並可以查看約會,如果他們按日期(例如3月24日)。 但現在顯示了數據庫的所有信息,這不是我想要的。 我想顯示用戶點擊的按鈕(日期)的約會,而不是數據庫的所有oppaintments。如何在datagridview中顯示特定日期的約會?(C#)
private void button2_Click(object sender, EventArgs e)
{
string selectie = " SELECT * FROM Appointment Order by AppointmentDate ";
OleDbConnection calendarconn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;data source=C:\Users\derek\Dropbox\C#_Project_Calender\Versie 1.0\Kalenderdb.accdb");
if (calendarconn != null)
{
Debug.WriteLine("calendarconn is not null: " + calendarconn);
calendarconn.Open();
OleDbCommand cmd = new OleDbCommand(selectie, calendarconn);
OleDbDataReader reader = cmd.ExecuteReader();
DataTable dt = new DataTable();
dt.Load(reader);
// achter je grid
this.dataGridView1.DataSourc
日Thnx傢伙我會嘗試 – user2215242 2013-03-27 12:13:46