Tuesday, July 17, 2012

Here's the way it can be used in ASP.NET Regular Expression Validator:

<asp:RegularExpressionValidator runat="server" ID="EmailAddress" Display="Dynamic" 
ControlToValidate="txtFirstName" ErrorMessage="Please enter a valid e-mail address"
 ValidationExpression="^([\w\d\-\.]+)@{1}(([\w\d\-]{1,67})|([\w\d\-]+\.[\w\d\-]
{1,67}))\.(([a-zA-Z\d]{2,4})(\.[a-zA-Z\d]{2})?)$"  ValidationGroup="CreateUserForm">
*</asp:RegularExpressionValidator>

Matches: name@domain.com | name@sub-domain.com.au | name@sub1.sub2.domain | name@organization.co.uk | name@domain.tv | name@domain.four | name@mailbox.com.us

Non-Matches: www.domain.com | name@.com | name@domain..com | name@anything@.com | name@com

Thursday, July 05, 2012

how to find by number's

--find no of stored procudere in a database
select count(*) from MMF..sysobjects where xtype='P'

----find no of table in a database
select count(*) from MMF..sysobjects where xtype='U'

--find no of columns in a table
select count(*) from information_schema.columns where table_name='login'

----find no of rows in a table
select count(*) from login

--note: here MMF is a database