I have created the simple CSLA.Net Application.when I am trying to execute the application I am getting the error.It is in the form of Dialog box.
Error:"WebDev.Webserver.exe has encountered a problem and needs to close.We are sorry for the inconvenience." and
When I am Debugging the Application I am getting the Exception "StackOverflowException was Unhandled".
Exception:"An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll" at the position "using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))"
The Following code is:
[
RunLocal()] private void DataPortal_Create(Criteria criteria){
_hiredate.Date =
DateTime.Today;ValidationRules.CheckRules();
}
private void DataPortal_Fetch(Criteria criteria){
using (SqlConnection cn = new SqlConnection(Database.employeeConnection)){
cn.Open();
ExecuteFetch(cn, criteria);
}
//using}
private void ExecuteFetch(SqlConnection cn, Criteria criteria){
using (SqlCommand cm = cn.CreateCommand()){
cm.CommandType =
CommandType.Text;cm.CommandText =
"Select empno, empname, hiredate, job,sal,city from employee where empno='" + criteria.empno + "'"; using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())){
FetchObject(dr);
ValidationRules.CheckRules();
}
}
//using}
protected void FetchObject(SafeDataReader dr){
dr.Read();
_empno = dr.GetString(
"empno");_empname = dr.GetString(
"empname");_hiredate = dr.GetSmartDate(
"hiredate");_job = dr.GetString(
"job");_sal = dr.GetInt32(
"sal");_city = dr.GetString(
"city");}
Please help me on this issue.
If any help would be appreciated.
Nothing immediately obvious. I would check the rules to
see if there is a custom rule that is causing the issue.
Sergey Barskiy
Senior Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: sunil
[mailto:cslanet@lhotka.net]
Sent: Saturday, April 12, 2008 9:59 AM
To: Sergey Barskiy
Subject: [CSLA .NET] Csla.Net Application Error
I have created the simple CSLA.Net Application.when I am trying to
execute the application I am getting the error.It is in the form of Dialog box.
Error:"WebDev.Webserver.exe has encountered a problem and needs to
close.We are sorry for the inconvenience." and
When I am Debugging the Application I am getting the Exception
"StackOverflowException was Unhandled".
Exception:"An unhandled exception of type
'System.StackOverflowException' occurred in mscorlib.dll" at the
position "using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))"
The Following code is:
[RunLocal()]
private void
DataPortal_Create(Criteria criteria)
{
_hiredate.Date = DateTime.Today;
ValidationRules.CheckRules();
}
private void
DataPortal_Fetch(Criteria criteria)
{
using (SqlConnection cn = new SqlConnection(Database.employeeConnection))
{
cn.Open();
ExecuteFetch(cn, criteria);
}//using
}
private void ExecuteFetch(SqlConnection cn, Criteria
criteria)
{
using (SqlCommand cm =
cn.CreateCommand())
{
cm.CommandType = CommandType.Text;
cm.CommandText = "Select
empno, empname, hiredate, job,sal,city from employee where empno='"
+ criteria.empno + "'";
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
{
FetchObject(dr);
ValidationRules.CheckRules();
}
}//using
}
protected void FetchObject(SafeDataReader dr)
{
dr.Read();
_empno = dr.GetString("empno");
_empname = dr.GetString("empname");
_hiredate = dr.GetSmartDate("hiredate");
_job = dr.GetString("job");
_sal = dr.GetInt32("sal");
_city = dr.GetString("city");
}
Please help me on this issue.
If any help would be appreciated.
Copyright (c) Marimer LLC