473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Problem manipulating asp.net membership programmatically

Hi

I am trying to manipulation asp.net membership programmatically from a
winform app. I have added the connectionstring and membership & role setting
fragment to my app's app.config file as per this article;

http://blogs.msdn.com/msdnts/archive...commentmessage

However when I try to use code like;

Dim ret As MembershipCreateStatus

in VB.net I get the error 'Type 'MembershipCreateStatus' is not defined'.
What am I doing wrong?

Thanks

Regards
Jun 27 '08 #1
3 1392
re:
!However when I try to use code like;
!Dim ret As MembershipCreateStatus
!in VB.net I get the error 'Type 'MembershipCreateStatus' is not defined'.
!What am I doing wrong?

You need to import the System.Web.Security namespace :

<%@ Import Namespace="System.Web.Security" %>


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"John" <in**@nospam.infovis.co.ukwrote in message news:%2****************@TK2MSFTNGP02.phx.gbl...
Hi

I am trying to manipulation asp.net membership programmatically from a winform app. I have added the connectionstring
and membership & role setting fragment to my app's app.config file as per this article;

http://blogs.msdn.com/msdnts/archive...commentmessage

However when I try to use code like;

Dim ret As MembershipCreateStatus

in VB.net I get the error 'Type 'MembershipCreateStatus' is not defined'. What am I doing wrong?

Thanks

Regards

Jun 27 '08 #2
Hi John,

Seems it's a compilation error. Sure that you add reference to System.Web.dll
and import the namespage System.Web.Security (see the reqs at http://msdn.microsoft.com/en-us/libr...atestatus.aspx)

Regards, Alex
Jun 27 '08 #3
Two things:

1. Make sure you have a reference to the System.Web DLL
2. Make sure you have a "imports" statement for System.Web.Security

You can set up a "global" reference in teh config, if you so desire.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
"John" <in**@nospam.infovis.co.ukwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Hi

I am trying to manipulation asp.net membership programmatically from a
winform app. I have added the connectionstring and membership & role
setting fragment to my app's app.config file as per this article;

http://blogs.msdn.com/msdnts/archive...commentmessage

However when I try to use code like;

Dim ret As MembershipCreateStatus

in VB.net I get the error 'Type 'MembershipCreateStatus' is not defined'.
What am I doing wrong?

Thanks

Regards
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Portman | last post by:
I've used the Membership classes in an ASP.NET 2.0 application to create an application that interfaces with an older SQL Server 2000 database. Everything is working except the following... Like...
1
by: ad | last post by:
I have created a custom Membership Provider, and set it as default membership provider in web.config. I have also set deny users ="?" in web.config. When I use a login control with it, it work...
5
by: sloan | last post by:
Are there any "gotchas" on deploying the default Membership Provider (aspnetdb) to a hosting provider? I'm about to do it. And how does one get to the "auto configurer" .. that allows you to...
2
by: Balaji | last post by:
Hi All, Can I use more than one membership provider for a given website? I understand only one of them could be default one. If yes, then how to programmatically access the other membership...
3
by: Ken Fine | last post by:
I'm interested in programmatically manipulating groups of ASP.NET controls by type. Can someone suggest code for the following? Loop through, say, all label controls on a page, and assigning a...
10
by: perplexed | last post by:
After a user logs in (ASP.NET 2.0 membership/roles), how do I programmatically access their UserId and other information stored in the ASP.NET database structure? A user may login at Login.aspx...
3
by: Max2006 | last post by:
Hi, I am using ASP.NET 2.0 Membership and I need to authenticate a user without using login control. Is there any sample code that shows me how to do that? Thank you, Max
3
by: Michael Lang | last post by:
Hi there, I have a web application that works fine on my local dev machine. However I'm having less success on my hosting environment. When I detach the database for this site, copy it to my...
1
by: jobs | last post by:
I'm using asp.net Membership security. Using the Password recovery control, users can reset/recover their passwords. Great. I've grid with all the users. I'd like to add a button so the admin of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.