C# Overloaded Method argument problem
Is there a file that contains the C# prototypes like in C++? (code below)
When I step through selectedDay(0) the values are as expected, but when selectedDay(3) is called
the argments are passed as (int.Parse(date[0]),int.Parse(date[2]),int.Parse(date[2])) instead of
the declared (int.Parse(date[0]),int.Parse(date[1]),int.Parse(date[2])).
I tried renaming the functions with no change. The selectedDay(3) function orginally contained the
(int.Parse(date[0]),int.Parse(date[2]),int.Parse(date[2])) error, so I am thinking there is some
static data I need to change.
Or is this some other type of problem?
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Text;
using System.Globalization;
using System.Data.OleDb;
private void Page_Load(object sender, System.EventArgs e){
if(!Page.IsPostBack){
selectedDay(DateTime.Today.Year,DateTime.Today.Mon th,DateTime.Today.Day);
}else{
selectedDay();
}
}
public void selectedDay(){
string day = Request.Form["selectedDate"];
string [] date = day.Split(',');
selectedDay(int.Parse(date[0]),int.Parse(date[1]),int.Parse(date[2]));
}
public void selectedDay(int year, int month, int day){
DateTime selectedDate = new DateTime(year,month,day);
dayArea.Text=selectedDate.ToString();
}
|