|
Just want to understand......you want a regular expression to see if the domain is a registered domain on the internet?
Tom Wright
tawright915@gmail.com
|
|
|
|
|
hello tom,
i want to validate a text box which should be accept only
"www.codeproject.com" type of string
thankx for your favorable reply..
regards,
koolprasad2003
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
the regexp would be:
www.codeproject.com
|
|
|
|
|
thankx for your favorable reply..
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
A regular expression for validating domain names as follows:-
^[a-zA-Z0-9]+([a-zA-Z0-9]\-\.]+)?\.(com|org|net|info|biz|co.uk|org.uk|net.uk|gov|gov.uk)$
But I prefer to use the following function, as I actually checks to see if the domain is hosted :-
Public Function IsWebAddressActive(ByVal URL As String) As Boolean<br />
Try<br />
Dim req As System.Net.HttpWebRequest<br />
Dim res As System.Net.HttpWebResponse<br />
<br />
req = System.Net.HttpWebRequest.Create(URL)<br />
'set the user agent <br />
'some site might brush you off if it is not set (to stop bots and scrapers) <br />
req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)"<br />
<br />
'get response from website<br />
res = req.GetResponse()<br />
res.Close()<br />
Return True<br />
Catch<br />
Return False<br />
End Try<br />
End Function
and to use it, you would call it as follows:-
Dim bIsWebSiteActive as boolean<br />
bIsWebSiteActive = IsWebAddressActive("http://www.codeproject.com")
which, hopefully with return True , or if the website is not online it would return False
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
thankx for your favorable reply..
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Hi,
I need to transfer data from MS-Access db to SQL server db. I am having the date/time field in MS-Access with format as "mm/dd/yyyy h:nn:ss AM/PM". Having the field in SQL server as datetime.
For eg, If I store current datetime - in MS-Access it will be like this "15/06/2007 7:07:17 PM", when i try to update it in SQL server it gives error as "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value."
How to solve this.
Rams.
Be simple and Be sample.
|
|
|
|
|
My guess is that SQL server is seeing 15/06/2007 as an American date i.e. the 6th day of the 15th month of 2007.
Check how you have your dates set up on SQL Server - are they set up as defaulting to mm/dd/yyyy?
Also how are you moving the data to SQL Server - DTS package, flat file, import wizard?
If you can let me know how you are transfering the data I can probably give you more specific help.
Regards
Guy
Cambridge UK
You always pass failure on the way to success.
-- modified at 12:04 Saturday 16th June, 2007
|
|
|
|
|
How can I use a stored procedure to return query results and populate a data grid control? I am using VB 6.0 and SQL 2005.
|
|
|
|
|
Same way as if you were not using a stored procedure.
Tom Wright
tawright915@gmail.com
|
|
|
|
|
Thanks for replying. If you can kindly provide me with some vb 6.0 code to achieve this goal. A parameter is passed to the stored procedure at runtime and records are retrieved by the stored procedure which then populates the grid.
|
|
|
|
|
If you created the stored procedure, then replace that stored procedure name instead of where you have put query in your code earlier.
Be simple and Be sample.
|
|
|
|
|
consider a StoredProc "TEST" with parameters a and b, both of string datatype.
call it like this..
Query = "TEST '"& value for a &"', '"& value for b &"'"
now execute the Query as you do with simple queries...
The name is Sandeep
|
|
|
|
|
hello frnds,
how can validate a URL using vb.net
means my textbox should accept only
http://www.codeproject.com
please help....
regards,
koolprasad20 03
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
|
Look at the RegularExpressionValidator control. You can set it to validate that the format of your textbox matches that of a valid URL - it has a builtin regular expression type of 'Internet URL' that even does the creation of the regex for you.
|
|
|
|
|
Couldn't he also use a maskedtextbox and create the mask for how a url should look?
Tom Wright
tawright915@gmail.com
|
|
|
|
|
Hi all,
I have a datagrid whose datasource is an arraylist.
On deleting the last row from the arraylist and refreshing the datagrid, the datagrid is displayed fine, but on clicking on any cell on the datagrid, an "Array index out of bounds exception" is thrown.
It works fine if i delete any other row from the datagrid.
What can be the problem here?
Thanks!!
|
|
|
|
|
My guess would be that you're asking for a row from your Array List that no longer exists.
|
|
|
|
|
Actually i am deleting from the arraylist first then setting the datasource to the datagrid.Something like
Datagrid1.datasource=Nothing
''Remove last row from arraylist
Datagrid1.Datasource = arraylist
Getting the error only for the last row though.
|
|
|
|
|
Hello
How to write text from textbox1 into file.txt at server? I am doing a web project with VB.net.
|
|
|
|
|
To create a file on server first you need the write permission on it, then try using streamwriter and streamreader.
Be simple and Be sample.
|
|
|
|
|
I want to lock the flexgrid but i want to use scrollbars how we do this so i tried readonly property but its not available
kankeyan
|
|
|
|
|
change the readonly to true.
but add your DGV to a panel.
now you can use the panel scrollbars.
A.E.K
|
|
|
|
|
Hi all.
I want to see the form in screen but, dont want to see it into taskbar panel.
i m using vb.net.
thanks
Sanjay
|
|
|
|