.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Membership.GeneratePassword, Number of Non-Alpha numeric characters

Posted By:      Posted Date: September 21, 2010    Points: 0   Category :ASP.Net


I am using ASP.NET 2.0, SqlMembershipProvider. In web.config, the min password length is set to 10 and minRequiredNonAlphanumericCharacters is set to 0.

I want to generate random passwords that only contain alpha-numeric characters. I have tried Membership.GeneratePassword(10, 0), but the resulting passwords still contain punctuation marks.

What am I doing wrong?



View Complete Post

More Related Resource Links

How to tell repeater to wrap text after certain number of characters for a particular column ?

I have a column in my repeater which allows as many as 255 characters and causes the page contents pushed away to the right if any of the record has all 255 characters in that column. How can I tell it to wrap the text after 50 characters ?Thanks,

How to count number of characters in a textbox?

On my current form I have it validating a Canadian Postal Address (xxx xxx). The space is optional but if the user does not use a space, then once the validation passes it will insert one. How can I count the first 3 characters of the textbox, insert a space, then add the rest of the characters?Thank you

Calculating number of spaces between characters


Hi all,

      I need to calculate the number of free spaces between two characters.Consider the following Example


string str = "This is       the   sample" ;

I need to calculate the spaces between "This" and "is"

als find the spaces between "is" and "the"


How to find it???...

extracting last four characters of a text column and storing it in a number column



is there a way to do the above, for example...I have a text column, Column A containing "172671-08-7892", I need 7892 to be extracted to another column of the type number, from there I need to divide by 2. If the remainder is 0, Column C will be updated as Female, if the remainde is 1, Column C will be updated as Male

Sort query results by the number of characters matched



I have a query that takes a multi-word search string and parses it to spit out a LIKE (with AND or OR) condition that I then insert into my dynamic query.

Example of my parsing:

    'cheese chocolate cake'))),
                                ' ', ' þ')
                                , 'þ ',
                                    ''), ' þ'
                    , 'þ'),
                    '%'' OR CakeName LIKE ''%') + '%'')' 

Say for example that a user searches for the string "cheese chocolate cake". My parsing would result in the following string:

(c.CakeName LIKE '%CHEESE%' 
OR CakeName LIKE '%CAKE%')

What I wan to do is sort the results based on the number of characters that were actually matched. So, if c.CakeName contained the following:


  • Cheese Cake
  • Chocolate Cake
  • Chocolate Cheese Cake
  • Lemon Cake

The results would be sorted thusly:

  1. Chocolate Cheese Cake
  2. Chocolate Cake
  3. Cheese Cake
  4. Lemon Cake

Limit number of characters in the view field



I wonder if I can limit number of characters that are being displayed in the view.  For example, one of the columns sometimes has very long description.  I want people to see only 300 characters, and if they want to read more, they have to click on the link to go to details.

Is it possible?

Thank you.

Pattern not catching a match if numeric preceeds an Alpha [Example included]


When a number preceeds a cell reference in an Excel arithmetic calculation a Regex match will not be found in that instance

If a string = "=IF(H84>H80*0.91,H84,H80*0.91)" <<<<<<  In this case two matches are made for 0.91 and for a 2nd 0.91
                      - vs -                         ____ |

What is the max limit for number of characters in multiline text in Sharepoint?



In Sharepoint list, i have a column define as multiline text.  I want to know, what is the max character limit in multiline text, and how can I increase it to unlimited text?

Thanks any help.

Abhijit Sil

vb.net 2005 : In which Numeric Datatype I can store the number 3271557120


In my application I need to calculate = 195 * 256 * 256 * 256.

In which type of Numeric dataType I can use to store this number, because I had already tried with int64,Long and Decimal...... I dont know why it is always giving me Exception like "Arithmetic operation resulted in an overflow" in all the datatypes......

left most character is an alpha or number?



How do I do a conditional check for the left most character if it is an alpha or number in a Derived Column Transformation? Something like

ISNUMERIC(newseq) ?  "ABC" : "DEF"


Convert English to Arabic number without changing any regional settings in .net

Well, most applications that I worked with was multilingual that supports English UI and Arabic UI.

And one of the major issue that we have faced is displaying Arabic numbers without the need of changing the regional settings of the PC.

So the code below will help you to display Arabic number without changing any regional settings.

dynamically adding sql server columns based on number of files in fileuploader


I want to create a new table to sql database at runtime.  The column names would be "Name", "Date", "Event".  I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files. 

For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"

I also would like that table name to be name dynamically from the textbox Name when the user enters the information.


I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!


Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")


Embeb a variable number of videos


I need to provide some alternate content for my non-Flash users.

I have a directory of video files that is scanned using the DirectoryInfo() function, and I want to use the results to embed all files ending in ".mov" in QuickTime players on a web form.

How would you approach this? Right now I am using the count on the array of videos to determine how many times to repeat the embed code.  But this seems inelegant.

Is there a way to have a single QuickTime player.ascx control that gets duplicated according to the number of videos available for display?

Article commenting by line number


I'm wondering what's the best way to approach an online article system that allows users to comment by clicking on the line they are commenting about? Essentially the same way Adobe Acrobat works with comments where you can click anywhere and the text is saved for that location.

I'm assuming a mix of jQuery would be the crux of the interface. The system would need to save comments so that when another user logs in, they will also see the other comments but they can´t edit them - only add their own.

Any suggestions would be great.

The number of members in the conceptual type ... does not match with the number of members on the ob



I've added a scalar property to an entity and now ASP.NET Dynamic Data scaffolding throws this error:

The number of members in the conceptual type 'TrainingModel.Users' does not match with the number of members on the object side type 'TrainingModel.Users'. Make sure the number of members are the same.

This happens at the following line in global.asax:
model.RegisterContext(typeof(TrainingModel.TrainingEntities), new ContextConfiguration() { ScaffoldAllTables = true });

Please help!

Multiple membership providers



In my web.config I have:

        <add name="ADProvider1"
        <add name="ADProvider2"

If I just have ADProvider1 it works, when I add ADProvider2, even though for testing I only use ADProvider1 I get an error: "Unable to establish secure connection with the server"

Am I adding the second provider to the membership section incorrectly?



Replacement options for Membership


Hi everyone,
     I tried to use Microsoft's Membership option for signing up new users and authenticating them on subsequent pages, but it has not worked very well. The biggest issue has been with the REMEMBER ME function. With this checked, I am randomly logged out in the middle of some functions and some pages always show me as not authenticated, while others properly show me as authenticated. I built a site based on VB.
I was wondering what other people are using ro register users and monitor authentication and also if anyone has had better experiences with other solutions. 

Hi everyone,

     I tried to use Microsoft's Membership option for signing up new users and authenticating them on subsequent pages, but it has not worked very well. The biggest issue has been with the REMEMBER ME function. With this checked, I am randomly logged out in the middle of some functions and some pages always show me as not authenti

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend