Posts Tagged ‘vb.net description’
This service is marked for deletion
Posted by: admin in .NET, Window Services on September 9th, 2009
This error occurs when you uninstall a windows service.
What you need to do is to close the mmc or services.msc if this was opened.
More information of this error refer to KB Article
How to Replace Multiple space with only one space
Use regular expression
RegexOptions options = RegexOptions.None;
Regex regex = new Regex(@”[ ]{2,}”, options);
tempo = regex.Replace(tempo, @” “);
VB.Net
Dim str As String = “Sample space 01″
Dim opts As RegexOptions = RegexOptions.None
Dim regx As New Regex(“[ ]{2,}”, opts)
str = regx.Replace(str, ” “)
How to assign Null Values to Date Type Variable in .Net
Posted by: admin in .NET, Date Formatting, VB.Net on May 18th, 2009
Actually, you can’t assign a null value to a Date Type variable but you can check if the variable has been set or not by comparing its current value versus default value (#12:00:00 AM#) of date/datetime, you can get the default value by using
-
Date.MinValue or DateTime.MinValue
To do this, let say you have a variable called LastUpdate with a data type of Datetime
-
Dim LastUpdate as DateTime
-
dim dr as Datarow
-
-
If DateTime.MinValue = LastUpdate Then
-
'Its Null value
-
'if you want to save the value to the database then use the DBNull.Value
-
dr("LastUpdate") = DBNull.Value
-
Else
-
dr("LastUpdate") =LastUpdate
-
End If
Multithreading in .Net
Posted by: admin in .NET, Multithreading on May 6th, 2009
A lock is a way to tell the computer that the following group of code should be executed together as a single operation, and not let other threads have access to the resource that is locked until the locking code is finished
Source: http://www.developerfusion.com/article/5184/multithreading-in-vbnet/2/
How to create Temporary filename in vb.Net
-
Private Sub TempFile()
-
Dim sTempFileName AsString = System.IO.Path.GetTempFileName()
-
Dim fsTemp AsNew System.IO.FileStream(sTempFileName, IO.FileMode.Create)
-
-
MessageBox.Show(sTempFileName)
-
-
'write data to the temp file
-
fsTemp.Close()
-
-
System.IO.File.Delete(sTempFileName)
-
End Sub
How to Clear StringBuilder
Posted by: admin in String Manipulation on April 20th, 2009
How to clear StringBuilder data;
Dim StrB as new StringBuilder
1. Way to clear is to set the Length to 0
-
StrB.Lenght = 0
2. Or reassign it
-
-
StrB = new StringBuilder
Putting Description on Function/Sub Routine
Posted by: admin in .NET, ASP.Net, VB.Net on February 25th, 2009
Just Type 3 single quotes (”’) above the function/ sub routine, VS will automatically generate an XML tags for you. see below
”’ <summary>
”’
”’ </summary>
”’ <param name=”name”></param>
”’ <param name=”index”></param>
”’ <param name=”path”></param>
”’ <remarks></remarks>
Public Sub New(ByVal name As String, ByVal index As Integer, Optional ByVal path As String = “”)
_name = name
_index = index
_path = path
End Sub
vb comments, vb.net description
No Comments