我有日曆,根據所選日期顯示信息。 它是這樣的:如何動態更新數據源C#?
string queryString = "SELECT * from events";
SqlCommand thisCommand = thisConnection.CreateCommand();
thisCommand.CommandText = queryString;
SqlDataReader reader = thisCommand.ExecuteReader();
if(true)
queryString = "SELECT Text from events where repeat = 1";
else
queryString = "SELECT Text from events where repeat = 0";
GridView1.DataSource = reader ;
GridView1.Bind();
我得到的錯誤是「數據源不支持服務器端數據分頁」
代碼無法編譯...''queryString'在本示例中未正確聲明 – Dalorzo 2014-10-09 15:29:33
我修復了它,我忘了粘貼初始聲明。 – User765876 2014-10-09 15:30:59
你是否需要在你的用戶界面中使用「分頁」行爲? – 2014-10-09 15:43:27