hi,
i made a web application that consist of 3 web forms.
The "page1.aspx" is the next:
Code:
public class Search : System.Web.UI.Page
Code:
{
protected System.Web.UI.WebControls.DropDownList lstStartingFrom2;
protected System.Web.UI.WebControls.TextBox txtDepartureDate2;
protected System.Web.UI.WebControls.DropDownList lstDestination2;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
private void btnSearch_Click(object sender, System.EventArgs e)
{
Server.Transfer("page2.aspx");
}
}
The "page2" ,that processes the parameteres i put in "page1" when i click the btnSearch button,is the next:
Code:
public class SearchResults : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataGrid DataGrid1;
private void Page_Load(object sender, System.EventArgs e)
{
findqosmax.FindQoSMaxim qosobject=new findqosmax.FindQoSMaxim();//make an object of a web service
int[] arr2=qosobject.SearchTrainQoSMaxima(); //call the method of the web sevice
int delay2=arr2[0];
Session["train_ws_ID"]=Convert.ToString(arr2[1]);
train.Service1 trainservice=new train.Service1();//make another one web service
DataSet searchtrainset= trainservice.SearchTrain (Request.Form["lstStartingFrom2"],
Request.Form["lstDestination2"],Convert.ToDateTime(Request.Form["txtDepartureDate2"]),delay2);
DataGrid2.DataSource=searchtrainset.Tables[0].DefaultView;
DataGrid2.DataBind();
}
private void Button1_Click(object sender, System.EventArgs e)
{
Server.Transfer("page3.aspx",true);
}
}
While the DataGrid2 takes the data from the database and returns the results ,however,when i try to click the button in "page2" in order to call the "page3.aspx" ,then appear the next error:
Code:
System.Web.Services.Protocols.SoapException: Server was unable to process request.
---> System.Data.SqlTypes.SqlTypeException:
SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and
12/31/9999 11:59:59 PM. at TrainService.Service1.SearchTrain(String startPlace, String destinationPlace,
DateTime departureDate, Int32 timeDelay) in c:\inetpub\wwwroot\trainservice\service1.asmx.cs:line 127 ---
End of inner exception stack trace ---
I beleieve that there isn't something wrong in datetimes ,because ,the methods of web services are called without problem in "page2.aspx" .The problem is only when i want to click the button in "page2.aspx" ,in order to call the "page3.aspx"
Thank you in advanced.
Sorry for my bad english!!