.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

How do I require a multiple of a type of expression (e.g. 2 uppers, 2 lowers, etc.) for password com

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :WPF

I read the pinned post on this forum for password complexity and tried to adapt it to my needs but can't seem to force the requirement of no length, 2 upper, 2 lower, 2 specials, and 2 numbers in the regex:

Started with from the forum post:  


And tried:


...but can't seem to get it to work.  As you can see, I've just duplicated the expression I'm trying to use to match the different categories twice to try and get the desired affect of enforcing a 2x match.  The pattern should match things like:


Thanks in advance.

View Complete Post

More Related Resource Links

Gmail style multiple Sign-in type combo...is it possible in asp.net?


I am developing a multi-company application and want my users to give the functionality like the following to switch companies.


Is this possible? then how?

Please help


Implicit-type lambda expression: is it possible?

Hi all, i was plaing around with LINQ and lambda expressions. I was trying to find duplicated files in my system. After a while a realized that duplicated could mean: - same name - same size and extension - ....   So i wrote this code: DirectoryInfo rootDirectory = ....; var groupFiles = selector => rootDirectory.EnumerateFiles("*", SearchOption.AllDirectories).GroupBy(selector).Select(g => new { g.Key, Info = g, Count = g.Count() }).Where(g => g.Count > 1); var groupsByName = groupFiles(f => f.Name); var groupsBySize = groupFiles(f => new { f.Length, f.Extension}); But i get the following error: Error 1 Cannot assign lambda expression to an implicitly-typed local variable So i tryed to make the type explicit and i realized that is not so easy. So what i'm missing?! IMPORTANT. 'm not tying to have the code working. I can solve the issue by duplicating code (even if i hate to do that) I'm rtying to improve my skills with LINQ and Lambda Expressions. Thanks all!!  

Arithmetic overflow error converting expression to data type smallint

Can anyone tell me what exactly this means? Arithmetic overflow error converting expression to data type smallint. 

Regular Expression for password

Hello All,   I want to get the password from the user in the following format, Sud_19!)86.   Minimum 7 char and Max 10. Always the first char should be in Caps. First 3 characters must be alphabets. Must contain Digits and Special char. It can be any number.   How to do this with the REGULAR EXPRESSION CONTROL in asp.   Please help me out of this.

Data type mismatch in criteria expression.

Protected Sub btnSave_OnClick(ByVal sender As Object, ByVal e As EventArgs) Dim StartDateYear As Integer = Int32.Parse(2000 + tbStartDateYear.Text) Dim StartDateMonth As Integer = Int32.Parse(ddlStartDateMonth.SelectedValue) Dim StartDateDay As Integer = Int32.Parse(ddlStartDateDay.SelectedValue) Dim startDate As Date = New Date(StartDateYear, StartDateMonth, StartDateDay) Dim folderStartDate As String = Convert.ToDateTime(startDate).ToString("dd.mm.yyyy") Dim projectName As String = tbProjectName.Text Dim projectCategory As String = ddlProjectCategory.Text Dim projectID As String = "" Dim objConnection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|MOPPS.mdb;") Dim insertSQL As String = "INSERT INTO Projects([Project Title], [Start Date], [Project category]) VALUES (@projectName, @startDate, @projectCategory);" Dim insertCommand As New OleDbCommand(insertSQL, objConnection) Dim IDSQL As String = "SELECT [ProjectID] FROM Projects WHERE [Project Title]='" & projectName & "' AND [Start Date]='" & startDate & "' AND [Project category]='" & projectCategory & "';" Dim IDCommand As New OleDbCommand(IDSQL, objConnecti

MVVM - Multiple ViewModels of same type --> Singel instance of view


I have a ViewModel that contains a property WorkSpaces:

public ObservableCollection<ServiceViewModel> WorkSpaces{get; set;}

The WorkSpaces I bind to a ContentControl that contains as ItemTemplate a DataTemplate which contains a TabControl

<ContentControl Content="{

A new expression requires (), [] or {} after type ??

Hello - I am fairly new to C# and I am having trouble with a line of code highlighted below. I get a
error: "A new expression requires (), [] or {} after type" Can someone help? Thanks
namespace BackgrountPrint
 class Program

       public BackgroundPrint.ReportService.ReportingService rs;
        public BackgroundPrint.ReportExecution2005.ReportExecutionService   rsExec;

        static void Main(string[] args)

           ReportService.ReportingService rs = new BackgroundPrint.ReportService.ReportingService

           rs.Credentials = CredentialCache.DefaultCredentials ;



An expression of non-boolean type specified in context where a condition is expected, near ','.


An expression of non-boolean type specified in context where a condition is expected, near ','.

SELECT Code, Name
FROM DimCounty c
WHERE PublicationId = 44
and ((c.Name = @CountySelection) OR 
((c.Code BETWEEN '001' AND '102') AND
((@CountySelection) = 'ACTUAL')) OR
((@CountySelection) = 'ALL'))
I am gettting an 'An expression of non-boolean type specified in context where a condition is expected, near ','.' when I try to run this query in reporting services.

SSIS 2008-Variable Expression Type Cast Syntax Error


Hi all members.

I need to ask for the following code. I need to convert the variable into a string.

"Select Distinct convert (int ,A.CustomerCategory) as AccountReceivableCategoryID, convert (varchar(40), B.Text) as AccountReceivableCategoryNameE
from Inkunde A , inpara B
where A.CustomerCategory= B.SearchItem
and B.Language1 = 'EN'
and B.ParameterName = 'CATEGORY'
and A.CustomerCategory = (DT_STR,200,1252) "+  @[User::CategoryID] +"
Order By A.CustomerCategory"

Kindly any member let me know, How to correctly use the Type Cast fucntion in variables

Thanks and Best Regards,


Data type mismatch in criteria expression: date



I am getting a "Data type mismatch in criteria expression" error when trying the following SELECT statement.

strdt and spdate are Date types in my vb codebehind and the Contract field name is a DateTime field.

thanks for your help



nmxSQL As String = "SELECT * FROM Nymex WHERE (NymexID='" & nymID & "' And Contract>='" & strdt & "' And Contract<='" & spdate & "')"

Password Strength Expression

It's been a while since I've had to use regular expressions.

Can someone explain this to me in layman's terms?


How to check for space in a password regex having multiple condition

I have a requirment where in the password field should accept all keys except space, it should have atleast one number , length should be 6 to 50
I tried following but did not work
1) Regex = @"^.*(?=.{6,50})(?=.*\d)(?=.*[a-zA-Z]).*$"

2) ^(?=[^\s])(?=[^\s]{6,50})(?=[^\s]*\d)(?=[^\s]*[a-zA-Z]).*$

Following are my test input text ( test case no 2 is having space at end)

ShouldNOT 654321-4
Should NOT654321-5
S houldNOT654321-6
ShouldNOT65432 1-7
S houldNOT 654321-9

Please help.

Thanks in Advance.
Rajendra Dewani

Regards Rajendra Dewani

Change the content type for multiple list items


I have a document library which is configured to manage content types.  Users will be expected to upload multiple documents into the library.  Then they will be expected to choose the content type of the file and fill in the required metadata.  The only difference in these content types is the template which will be used to create new files of the specific content type so the columns are identical for each content type.

I have created a public view with inline editing enabled but Content Type is not an editable field.

The problem I have is that when I enable Inline editing, the users don't have an opportunity to select the content type, even though the files have just been uploaded and have not been checked in.

My question is this; how can users change the content type of multiple items without having to go through the complete New Item form? 

With literally thousaands of documents to be imported, having the users fill out a separate form for each document when many will have the same column values is a show stopper for our rollout.  It will take too much time.  The project will be a failure. 

I've also tried to create a datagrid view but the same problem exists.  Content type is not an editable column value.

Thanks for helping.


Visio File Type Requesting for Username and Password


Hello all,

PS2007 to PS2010 migration went well in a Test Environment, but only one issue remains. When opening Visio file for editing, it constantly requests for username and password. I have ticked 'Remember Password', but that doesn't seem to work. Opening it in Read-Only mode is fine.

Please note that I asked this question in the Project Server Upgrade Forum, but I was told it is related to SharePoint. Can someone please assist?

Thank you,


Multiple Content Types in a single list - how to edit fields outside a content type

I have a single list and created two content types on the list in order to reduce the amount of visible fields a user sees when entering a form.  Once the form is filled out by one group with the limited data, an alert is sent to another team that adds to the list item using the larger set of fields defined by the second content type.  Unfortunately it seems that the edit burron remembers ihe initial content type that the entry was created with.  Is there another url to access the edit button for the same entry using the alternate content typr?

can you upload multiple documents (to a doc library) and set content type and meta data at same time

can you do this?  it doesn't seem like the dialogs support this functionality.  As an alternative i tried doing it in a grid type view after the fact but i couldn't get the grid view to show the content type, even worse, the grid view would let me add meta data to content types that didn't even have that column as long as it was in the view!!

Extending a ListBox Control - How to make the extended type require the listbox items implement a ch


I am working on a drag and droppable timeline control, and I am making decent progress.  What I have so far will work decently enough with MVVM design patterns, but I am inexperienced with this kind of advanced control extending so I am sure that some of my methods are crude at best.

I have an extended content presenter control that I want to ensure is what is actually used inside my specialized listbox.  Right now I do the following:

<DataTemplate x:Key="TempTemplate" DataType="{x:Type local:TempDataType}">

			<tt:TimeLineItemControl StartTime="{Binding Path=StartTime}
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