Survey Software by Prezza Technologies - survey software, web surveys, online surveys, online survey, customer feedback forms, survey hosting

Go Back   CHECKBOX® Online Community > Checkbox® > CHECKBOX® Developer Kit

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-27-2008, 05:22 AM
richardt richardt is offline
Junior Member
 
Join Date: Feb 2008
Posts: 8
Default Problem with custom profiles

Hi, I've got a weird problem...

I've added two custom profile fields. When I specify the values through the web user interface, I have no problems. However, when I specify them through the UserManagementWebService, and then try to view the users in Checkbox, I get an error

Code:
An application error occurred.

Error Message: Unable to cast object of type 'System.Int32' to type 'System.String'. 
Source: App_Web_edituser.aspx.70ab9a11 
Target Site: Void LoadCustomUserInfo() 
 
URL: http://survey.education.co.uk/Users/EditUser.aspx 
Referrer: http://survey.education.co.uk/Users/ManageUsers.aspx?userCreated=true 
 
User Agent Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506) 
User Host Name 192.168.1.41 
User Host Address 192.168.1.41 
 
Stack Trace: at CheckboxWeb.Users.EditUser.LoadCustomUserInfo()
at CheckboxWeb.Users.EditUser.LoadUserProfile()
at CheckboxWeb.Users.EditUser.Page_Load(Object sender, EventArgs e)
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at CheckboxWeb.AuthPage.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
In the tables, the values *seem* to be set correctly;

ckbx_CustomUserField
Code:
CustomUserFieldID	CustomUserFieldName	Position	IsDeletable	Hidden
2	ContactID	2	0	0
3	EducationNumber	3	1	0
1	Email	1	0	0
ckbx_CustomUserFieldMap
Code:
UniqueIdentifier	CustomUserFieldID	Value
jamesb	1	jamesb@education.co.uk
tapmantwo@hotmail.com	2	C99
tapmantwo@hotmail.com	3	123
jamesb	3	123
jamesb	2	C99
tapmantwo@hotmail.com	1	jamesb@education.co.uk
richard.tappenden@btopenworld.com	2	C232
richard.tappenden@btopenworld.com	3	325897
richard.tappenden@btopenworld.com	1	richard.tappenden@btopenworld.com
test	2	c1
test	3	012
test	1	a@b.c
Users jamesb & test shows fine - the others do not (both were entered manually into checkbox).

I can't see any other differences?

For reference, my code to create the user is as follows;

Code:
			Dim profileProps(2) As Checkbox.SimpleNameValueOfObjectObject
			profileProps(0) = New Checkbox.SimpleNameValueOfObjectObject
			profileProps(0).Name = "ContactID"
			profileProps(0).Value = registration.ContactID
			profileProps(1) = New Checkbox.SimpleNameValueOfObjectObject
			profileProps(1).Name = "EducationNumber"
			profileProps(1).Value = registration.EducationNumber
			profileProps(2) = New Checkbox.SimpleNameValueOfObjectObject
			profileProps(2).Name = "Email"
			profileProps(2).Value = registration.EmailAddress

			Dim addedToCheckBox As Boolean = False
			Try
				Dim checkboxResult As String = checkBoxWS.CreateUser(authToken.Value, registration.UserName, registration.Password, profileProps, True)
				addedToCheckBox = True
			Catch ex As Exception
				addedToCheckBox = False
			End Try
In my developer version, it all works fine!?

I'd appreciate any help I can get please.
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 01:39 PM
ncushing ncushing is offline
Administrator
 
Join Date: Mar 2007
Location: Prezza Technologies
Posts: 160
Default

I'm looking at the source for the edit user page right now. There is only one place where a value is cast to a string, though I can't see how the profile property value would have anything other than a string value, especially since the values are stored as nvarchar in the database.

Just out of curiosity, if you reset IIS then access the user manager, does the problem still exist for the users?

Thank you.
Reply With Quote
  #3 (permalink)  
Old 03-03-2008, 03:55 AM
richardt richardt is offline
Junior Member
 
Join Date: Feb 2008
Posts: 8
Default

Hi,

I've just tested - and yes, if I restart the IIS service it fixes the problem. This obviously isn't a practical solution for me - the webserver runs many other web sites as well.

It's almost definately application caching or something - if I leave it a while (and the application stops/starts due to the .NET lifecycle) it starts to work.

Incidently - shouldn't it always be possible to cast an integer to a string (unless its null)?

Cheers

Richard
Reply With Quote
  #4 (permalink)  
Old 03-04-2008, 01:05 PM
ncushing ncushing is offline
Administrator
 
Join Date: Mar 2007
Location: Prezza Technologies
Posts: 160
Default

One workaround for the IIS reset is to put Checkbox in it's own application pool and recycle that. That's obviously not a long term solution, but may work in the interim until we are able to address the issue.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 09:49 PM.


Search Engine Friendly URLs by vBSEO 3.0.0 RC8