0
Hy發送給所有人,從訪問數據庫中標記日曆
在嘗試將日曆與數據庫綁定或連接時遇到問題。 應用程序(訪問數據庫)不斷更新新的日期,每次用戶登錄我需要顯示從數據庫到日曆的日期。 首先,我是C#的新成員,並且正在爲工作創建簡單的應用程序。 我創建了一個填充數據網格的查詢(所以管理員可以操作),但無法找到填充日曆中選定日期的方式。
try
{
string ID = labelIDFT.Content.ToString();
string Query = "SELECT Ferie.Data FROM Ferie WHERE (Ferie.Login LIKE '%"+ ID +"%')";
OleDbCommand cmnd = new OleDbCommand(Query, ConFerie);
ConFerie.Open();
cmnd.CommandType = System.Data.CommandType.Text;
OleDbDataAdapter da = new OleDbDataAdapter(cmnd);
DataTable tbl = new DataTable();
da.Fill(tbl);
dataGrid.ItemsSource = tbl.DefaultView;
ConFerie.Close();
}
catch (Exception ex)
{
ConFerie.Close();
MessageBox.Show("A handled exception just occurred: " + ex.Message, "Exception Sample", MessageBoxButton.OK, MessageBoxImage.Warning);
}
</i>
我試圖創建一個數據集,但我不知道如何綁定到日曆。 任何人都可以幫助我? THX