Jul 15, 2009

Failed to access IIS metabase.

Failed to access IIS metabase.

Problem
Failed to access IIS metabase.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.

The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.
Solution :-
This Error Caused Because You Not Have Register ASP.Net with IIS.Please Follow Following Step to Regiser ASP.Net With IIS.
-> Go to Start - > Run -> Cmd.

-> GO to Your System Drive Mostly C Drive.

-> Type C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -i
Just wait And Message comes Successfully Register.

Unable to start debugging on the web server.

Unable to start debugging on the web server.

Following Error Comes When web Server is not configured correctly

"Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information."


Do the Following Step To resolve This Error

Step 1 : Open IIS ( Internet Information Service )

To Open IIS start >> Run Window >> Writr "inetmgr" Click Ok

Step 2 : Select your Application Directory Or Virtual Directory

Step 3 : Right Click On Application Directory Click On Create Button ( on Directory Tab )

Step 4 : Go On Asp.net Tab and Select correct Asp.net version .

Step 5 : Finally CLick On Apply .

Error solution

Failed to access IIS metabase.
Failed to access IIS metabase.


This Problems occurs When you have both Microsoft Dot Net 2003 And 2005 in Your Pc .

In This Case You have to Install IIS After insalling .NET framework .

Do this Following Steps To resolve "Failed to access IIS metabase " issue


Step 1. repair .net
Step 2.Run This Command From Run Command Window ( Start >> Run ):-
"c:\WINNT\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -i "


Finally Check ASP.NET version is associated with the virtual directory .

For That Do Following :-

- Right Click virtual directory name
- Select Properties
- Then ASP.NET tab
- Select ASP.Net Version

Hope So , This Will Help U ..

Jul 10, 2009

Regular Expression Important

RegularExpressions Class
The Regex class contains several static methods that allow you to use a regular expression without explicitly creating a Regex object. Using a static method is equivalent to constructing a Regex object, using it once and then destroying it.

Sample Code 1

Imports System.Text.RegularExpressions
' import the namespace

'instantiate the objects
dim oRegex as new regex("test pattern")

'use the object
If oRegex.IsMatch("this is the string to test on") Then
msgbox "Match found"
else
msgbox "Did not find match"
end i


Sample Code 2

//Check for correct format of your name

Dim myMatch As Match = System.Text.RegularExpressions.Regex.Match(InsertYourName, "^[A-Z][a-zA-Z]*$")

If Not myMatch.Success Then

'Name was incorrect

ErrorMessage("Invalid Name", "Message")

txtFname.Focus()

Return

End If


Regular Expressions Elements:

* . Character except a newline character(\n)
* \d Any decimal digit
* \D Any nondigit
* \s Any white-space character
* \S Any Non-white-space charater
* \w Any word character
* \W Any nonword character
* ^ Beginning of string or line
* \A Beginning of string
* $ End of string or line
* \z End of string
* | Matches one of the expressions seprated by the vertical bar; example eee|ttt will match one of eee or ttt (tracing left to right)
* [abc] Match with one of the characters; example [rghy] will match r, g,h or c not any other character.
* [^abc] Match with any of character except in list; example [ghj] will match all character except g,h or k.
* [a-z] Match any character within specified range; example [a - c] will match a, b or c.
* ( ) Subexpression treated as a single element by regular expression elements described in this table.
* ? Match one or zero occurrences of the previous character or subexpression; example a?b will match a or ab not aab.
* * Match zero or more occurences of the previous character or subexpression; example a*b will match b, ab, aab and so on.
* + Match one or more occurences of the previous character or subexpression; example a+b will match ab, aab and so on but not b.
* {n} Match exactly n occurrences of the preceding character;example a{2} will match only aa.
* {n,} Match minimum n occurrences of the preceding character;example a{2,} will match only aa,aaa and so on.
* {n,m} Match minimum n and maximum n occurrences of the preceding character;example a{2, 4} will match aa, aaa, aaaa but not aaaaa.

Jul 7, 2009

Best site for Lear VB.net / C# .net / PHP etc

http://www.homeandlearn.co.uk/NET/vbNet.html

Sending Mail Using GMAIL in your Application

Public Sub sendmail()
' Sending Mail to Multiple Recipient

Dim mails As Net.Mail.MailMessage = New Net.Mail.MailMessage()
Try
mails.To.Add(txtemail.Text)
mails.From() = New MailAddress("Your mail id here")
mails.Subject() = txtsubject.Text


mails.IsBodyHtml = True
mails.Body = texteditor.Content
'Attaching the File
Dim attachFile As New Attachment(Server.MapPath("Attachfile.doc"))
mails.Attachments.Add(attachFile)


Dim SMTPServer As New SmtpClient("smtp.gmail.com")
SMTPServer.Port = 587
SMTPServer.Credentials = New System.Net.NetworkCredential("yourmailidhere@gmail.com", "password")
SMTPServer.EnableSsl = True
SMTPServer.Send(mails)





Catch ex As Exception

End Try

End Sub

Jul 4, 2009

Important For Interview

Helpful for all dear

http://www.dotnetuncle.com/