Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 30th, 2006, 04:47 PM
Authorized User
 
Join Date: Apr 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default Data source control for Create User

I have an SqlDataSource for accessing table information located on a remote shared SQL Server. In this same database I have an existing Users table with custom field names. Can I use the CreateUserWizard control to connect to this data source for the purpose of adding new users. My Sql database is located on a remote server in a shared environment.

I cannot find a data source selection in the CreateUserWizard properties.
 
Old May 30th, 2006, 05:16 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You can take a look at this thread: http://p2p.wrox.com/topic.asp?TOPIC_ID=41084

It explains how to add additional information to the existing users.
If that's not enough, you need to write your own provider, which is not as bad as it sounds, although it means quite a lot of work.

This article is probably a good place to start: http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=380

Hope this helps,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old August 16th, 2006, 12:40 PM
Registered User
 
Join Date: Aug 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,
I have reviewed the thread http://p2p.wrox.com/topic.asp?TOPIC_ID=41084
 and How to add a Login, Roles and Profile system to an ASP.NET 2.0 app in only 24 lines of code
I am doing exactly the same thing,creatinga new Listbox in teh create user.
But when i add the selectedvalue,it throws exception,which says myProfile.Education = CType(CreateUserWizard1.CreateUserStep.ContentTemp lateContainer.FindControl("Education"), DropDownList).SelectedValue

NullReferenceException: Object reference not set to an instance of an object.]

pls help me.
 
Old August 16th, 2006, 12:43 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Does it say where it crashes? That is, what object is null??

Have you tried setting a breakpoint, and by debugging looked at the variables and their values?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old August 16th, 2006, 01:15 PM
Registered User
 
Join Date: Aug 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I tried with try and catch ,and this is where the problem is
myProfile.Education = CType(CreateUserWizard1.CreateUserStep.ContentTemp lateContainer.FindControl("Education"), DropDownList).SelectedValue


 
Old August 16th, 2006, 01:16 PM
Registered User
 
Join Date: Aug 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If this could help you guide me
[NullReferenceException: Object reference not set to an instance of an object.]
   _Default.CreateUserWizard1_CreatedUser(Object sender, EventArgs e) in D:\Projects\SQLProviderTest\Register.aspx.vb:11
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.WebControls.CreateUserWizard.OnCreat edUser(EventArgs e) +75
   System.Web.UI.WebControls.CreateUserWizard.Attempt CreateUser() +320
   System.Web.UI.WebControls.CreateUserWizard.OnNextB uttonClick(WizardNavigationEventArgs e) +107
   System.Web.UI.WebControls.Wizard.OnBubbleEvent(Obj ect source, EventArgs e) +412
   System.Web.UI.WebControls.CreateUserWizard.OnBubbl eEvent(Object source, EventArgs e) +123
   System.Web.UI.WebControls.WizardChildTable.OnBubbl eEvent(Object source, EventArgs args) +17
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
   System.Web.UI.WebControls.Button.OnCommand(Command EventArgs e) +86
   System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +155
   System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4919


 
Old August 16th, 2006, 01:30 PM
Registered User
 
Join Date: Aug 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar
myprofile.education value shows as null.

 
Old August 16th, 2006, 02:01 PM
Registered User
 
Join Date: Aug 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,pls help

 
Old August 16th, 2006, 02:03 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

It could be null the first time, if a value hasn't been set before.

How did you set up the profile? Do you get Intelli Sense on the Education property?

And did you try debugging?

You can also try something like this:

Dim myDropDown As DropDownList = _
CType(CreateUserWizard1.CreateUserStep.ContentTemp lateContainer.FindControl("Education"), DropDownList)

Does that result in a valid DropDownList control when you debug it?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old August 16th, 2006, 02:04 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
quote:Originally posted by papa
 Hi Imar,pls help
 Hi again,

Messages like this don't help. If I have time, you get an answer. If I don't have time, you don't get an answer... ;)

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot create a connection to data source error mojo1979 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 April 22nd, 2008 10:24 AM
Best Data Source Control to Use in ASP.Net 2.0 srotondo ASP.NET 2.0 Basics 2 January 23rd, 2008 05:30 PM
Create Dynamic User Control Prabhakar_dt ASP.NET 2.0 Professional 1 June 6th, 2007 07:30 AM
How to create reports based on TFS Source Control woojtii Visual Studio 2005 0 March 28th, 2007 04:16 AM
Cannot create a connection to data source dba123 Reporting Services 0 March 8th, 2006 04:46 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.