473,379 Members | 1,544 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,379 software developers and data experts.

In asp(web app) it is required field validator what in vb (window app)

seshu
156 100+
Hi Everybody
it has been a long time me coming into this site well today i am back with a small doubt in asp.net for designing a web page we take required field validators to check whether the user has entered the correct format of email address or not but here in window app using vb how to validate a textfield whethere the user has given the correct email id or not are there any tolls are we need to go by coding if have to go by coding then some one plz help me out


regards
seshu
Mar 21 '07 #1
3 1242
sani723
117 100+
i never worked in desktop app but i think there isn't aby use the function to validate email

Imports System.Text.RegularExpressions

Function EmailAddressCheck(ByVal emailAddress As String) As Boolean

Dim pattern As String = "^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"

Dim emailAddressMatch As Match = Regex.Match(emailAddress, pattern)

If emailAddressMatch.Success Then
EmailAddressCheck = True
Else
EmailAddressCheck = False
End If
End Function
Mar 21 '07 #2
Hi Everybody
it has been a long time me coming into this site well today i am back with a small doubt in asp.net for designing a web page we take required field validators to check whether the user has entered the correct format of email address or not but here in window app using vb how to validate a textfield whethere the user has given the correct email id or not are there any tolls are we need to go by coding if have to go by coding then some one plz help me out


regards
seshu
Hi Seshu

For email Validation we can use Object on textbox Validating Event put the code it will help you

Expand|Select|Wrap|Line Numbers
  1. Dim reg = CreateObject("VBScript.Regexp")
  2.         Dim sParams As String
  3.         sParams =Textbox1.Text
  4.         reg.pattern = "^(\w+\.)*(\w+)*(\w+\-)*(\w+)@(\w+\-)*(\w+\.)+([a-zA-Z]{2,4})$"
  5.         If (sParams = "") Then
  6.         MsgBox("Please Insert its Blank)
  7.         Textbox1.Focus()
  8.         Else
  9.             If (reg.test(sParams) = False) Then
  10.                 MsgBox("Please Insert valid Emailid")
  11.                 Textbox1.Focus()
  12.             End If
  13.         End If
Mar 21 '07 #3
seshu
156 100+
Thank you mahesh
you have really helped me out because i dont get satisfy if i dont compleet my work in a satisfied manner
since morning i was strugling to write this kind of code but i dint get any iodea
any how thank you once again
regards
seshu
Mar 21 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: James M. | last post by:
I have 2x Front-end Web servers (Win2003 Ent IIS6.0), setup with NLB (single Affinity, also using SQLServer session state) that are hosting a few .NET ASP web applications under the Default Website...
5
by: Richard Gutery | last post by:
G'day. Slight problem that has me perplexed. We have an ASP app running on Win2K IIS 5.1, devloped on WinXPpro. Up until the other day, the app worked without problems. Now, the app hangs on...
1
by: feng | last post by:
I would like to use asp web form's TextBox control for my password field but I don't know how to do this. I know I can use HTML textbox and then set the type="password". In asp TextBox, however,...
5
by: Tom | last post by:
We have an ASP web site done with VB.NET. This website is also checked into SourceSafe. Now we need to move/copy this web site over to a different server - a QA and/or Production server. I am...
0
by: Rico | last post by:
Hello, I have an ASP web app with an SQL back end. It's currently connecting to an SQL Server 2000 database using an ODBC DSN. I am currently migrating to a new Windows 2003 Server machine...
2
by: Knich | last post by:
Can you run an client application (i.e. Excel) from an ASP web page? I want to open an Excel document that is stored on the network in the Excel App (not in browser window) allow the user to make...
1
by: gotgame0314 | last post by:
I am new to asp.net and would like to know the easiest way to view an Excel file in my asp app.
9
by: CK | last post by:
Good morning all, We have a classic asp application on our local intranet. Employees log in to and use the app. We recently added some additional functionality to the site and this was written in...
6
by: JimLad | last post by:
Hi, We have a major ASP app that we are in the process of upgrading to ASP.NET 1.1 and probably on to ASP.NET 2.0 in the middle of next year. (We will also be upgrading to SQL2K5 at the same...
10
by: Garry | last post by:
I need to build a web site that can automatically download a file from the server to the users local C: drive and then open the file in Word on the local PC) How can I do this ? If i write a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.