Hi,
i am getting the error below. i have no idea why it occurs. everthing seems pretty good to me. here is what i have and at the bottom is the error i am getting.
Transaction trans = new Transaction(IsolationLevel.ReadCommitted, "UpdateUser");
try
{
UpdateStaff(userTitleId, firstName, middleName, lastName, nickName, password, eMail, homePhone, photo, userId, trans);
UpdateAddress(address1, address2, city, state, zipCode, userId, trans);
UpdateStaffHistory(academicYearId, departmentId, userId, trans);
trans.Commit();
return userId;
}
catch (Exception)
{
trans.Rollback();
throw;
}
the updatestaff part of this code runs fine. it jumps in the updateaddress part in where it finds the address of the user using the userid and updates it.
this is where i am getting the error.
here is my updateaddress:
private static void UpdateAddress(string address1, string address2, string city, string state, string zipCode, int userId, Transaction trans)
{
AddressEntity address = UserGuiHelper.GetUserAddress(userId);
// add it to the transaction
trans.Add(address);
address.AddressLine1 = address1;
address.AddressLine2 = address2;
address.City = city;
address.State = state;
address.PostalCode = zipCode;
// update user address and get its addressid
address.Save();
}
and getuseraddress is:
public static AddressEntity GetUserAddress(int userId)
{
UserEntity user = GetUser(userId); ---> this line gives the error
AddressEntity toReturn = user.Address;
return toReturn;
}
and my getuser is:
public static UserEntity GetUser(int userID)
{
UserEntity user = new UserEntity(userID);
return user.IsNew ? null : user;
}
is it something about the transaction?
using ver 2.6, self servicing, sql express 2008 .net 3.5
Server Error in '/00-GUI' Application.
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Source Error:
Line 1742: IDao dao = this.CreateDAOInstance();
Line 1743: base.Fields[(int)UserFieldIndex.UserId].ForcedCurrentValueWrite(userId);
Line 1744: dao.FetchExisting(this, base.Transaction, prefetchPathToUse, contextToUse, excludedIncludedFields);
Line 1745: return (base.Fields.State == EntityState.Fetched);
Line 1746: }