Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Error:-ystem.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime.

at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)



Code following:-

C#
namespace Age_Calculator_Apps
{
    public partial class Form1 : Form
    {
        //ServiceReference1.Age_calculationSoapClient obj = new ServiceReference1.Age_calculationSoapClient();
        localhost.Age_calculation obj = new localhost.Age_calculation();
        int day, month, year;
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {

            day = Convert.ToInt32(textBox1.Text.ToString());
            month = Convert.ToInt32(textBox2.Text.ToString());
            year= Convert.ToInt32(textBox3.Text.ToString());

            int days = obj.converttodaysweb(day,  year, month);

            MessageBox.Show("you are"+ " "+ days +""+ "days year old");
        }
    }
}
Posted
Comments
Richard MacCutchan 6-Oct-14 6:05am    
What are the values you get from your convert functions? And why are you calling ToString on string objects?
Pheonyx 6-Oct-14 6:06am    
Have you checked that day/month/year are all populating correctly?
Also, you are sending to the soap services in the order day,year,month that stands out as being a bit odd. I suggest you check the order you need to send them.
Nishant.Chauhan80 6-Oct-14 6:16am    
thanku sir TOString remove this code its working

1 solution

As a total guess.

Inside that Age_Calculation, I think it is trying to get the total Ticks that have occurred.

Check the way in which you call it, as you are passing up

Day, Year, Month.

The error is stating that the system date time is not correct, System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)

Try changing your code to call the obj in the order of Year, Month, Day.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900