2012-05-07 4 views
0

私はSQLデータベースから日付を取得するカレンダーツールを作成しようとしています。C#Calendar Tool ASP.NET

私はここでTableAdapterのを作成しました:http://bit.ly/KRaTvr

これは私が私のカレンダーを作成する必要がASPの小さなビット:

その後
<asp:Calendar ID="calEvents" runat="server"> </asp:Calendar>  

私が持っていた私のプロジェクトのC#情報を引き出す。

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using System.Data; 
using System.Data.SqlClient; 
using BreakyBottomTableAdapters; 

public partial class Events : System.Web.UI.Page 
{ 

    protected void Page_Load(object sender, EventArgs e) 
    { 

     //Data Table 
     BreakyBottom table; 
     //Table Adapter 
     BreakyBottomTableAdapters.ScheduleDate ta; 
     ta = new BreakyBottomTableAdapters.ScheduleDate(); 
     //Populate the table using the Table Adapter passing current date 
     table = ta.GetData(e.Day.Date); 
     //Check the number of rows in the data table 
     if (table.Rows.Count > 0) 
     { 
      //Change the background colour to gray 
      e.Cell.BackColor = System.Drawing.Color.Gray; 
      //Allow the Day to be selected 
      e.Day.IsSelectable = true; 
     } 


    } 
} 

今、私は何かが欠けていますが、私はそれが何であるか私のフィギュアうちの生活のためにすることはできません知っています。

コンパイルエラーのスクリーンショットは次のとおりです。http://bit.ly/ISuVsT - わかりやすいことが分かりましたが、助けてくれれば幸いです。

protected void Page_Load(object sender, EventArgs e) 
{ 
    .... 
    table = ta.GetData(e.Day.Date); //WRONG: Day is not a member of EventArgs 
} 

を考えは現在の日付を使用する場合:

よろしく

答えて

1

コンパイラはEventArgsあなたは明らかに間違ってあなたのコード内で使用しているすべてのメンバーがDayと呼ばれていないことを語っています、あなたが述べたように、この操作を行います。

table = ta.GetData(DateTime.Now); 
+0

感謝の迅速な対応のために、私は実際に私が投稿して終了ストレートの後にすることを試みたイカルスこのエラーが発生します。 "INSERT Database/TableAdapterここには無効な引数があります" 私は現在探しているものの、完全に論理的です。なぜ私はこのエラーが出ているのか分かりません。 – user1380485