Tuesday, August 30, 2011
Pinals Book
Now Pinal's books R available in India .
Here is the link
Book 1:Beginning SQL Joes 2 Pros http://bit.ly/pinalbook1
Book 2:SQL Queries Joes 2 Pros http://bit.ly/pinalbook2
Book 3:SQL Architecture Basics Joes 2 Pros http://bit.ly/pinalbook3
Book 4:SQL Programming Joes 2 Pros http://bit.ly/pinalbook4
Book 5:SQL Interoperability Joes 2 Pros http://bit.ly/pinalbook5
Here is the link
Book 1:Beginning SQL Joes 2 Pros http://bit.ly/pinalbook1
Book 2:SQL Queries Joes 2 Pros http://bit.ly/pinalbook2
Book 3:SQL Architecture Basics Joes 2 Pros http://bit.ly/pinalbook3
Book 4:SQL Programming Joes 2 Pros http://bit.ly/pinalbook4
Book 5:SQL Interoperability Joes 2 Pros http://bit.ly/pinalbook5
Wednesday, August 24, 2011
Monday, August 15, 2011
Access problem while Copying & moving content of a file from one folder to another folder
Hi All,
This below code is to read the content of a file & moving that file from one folder to another folder
in vb.net.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.ClickDim di As New IO.DirectoryInfo("D:\Test")Dim diar1 As IO.FileInfo() = di.GetFiles()Dim dra As IO.FileInfoDim fs As System.IO.FileStreamDim sr As StreamReaderDim line As String = ""
For Each dra In diar1'fs = New FileStream(di.ToString + "\" + dra.ToString, FileMode.Open, FileAccess.Read)fs =
sr =
New FileStream(di.ToString + "\" + dra.ToString, FileMode.Open, FileAccess.Read, FileShare.Read)New StreamReader(fs)Dim LineCount As Integer = 0While Not (sr.EndOfStream())'line = sr.ReadToEnd()line = sr.ReadLine()
LineCount += 1
End Whilefs.Close()
NextMoveProcessedFiles(
"D:\Test\", "D:\Test1", "Test.txt")End Sub
Sub MoveProcessedFiles(ByVal StrSourceFilePath As String, ByVal StrTargetDir As String, ByVal strFileName As String)Dim oldFile, newFile, TargetDir As StringTryoldFile = StrSourceFilePath + strFileName
TargetDir = StrTargetDir
newFile = TargetDir +
"\" + strFileNameIf Not File.Exists("D:\Test1\" + strFileName) ThentheFile.Close()
File.Delete(newFile)
Catch ex As Exception'MsgBox(ex.Message)FinallyEnd Try
End Sub
This below code is to read the content of a file & moving that file from one folder to another folder
in vb.net.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.ClickDim di As New IO.DirectoryInfo("D:\Test")Dim diar1 As IO.FileInfo() = di.GetFiles()Dim dra As IO.FileInfoDim fs As System.IO.FileStreamDim sr As StreamReaderDim line As String = ""
For Each dra In diar1'fs = New FileStream(di.ToString + "\" + dra.ToString, FileMode.Open, FileAccess.Read)fs =
sr =
New FileStream(di.ToString + "\" + dra.ToString, FileMode.Open, FileAccess.Read, FileShare.Read)New StreamReader(fs)Dim LineCount As Integer = 0While Not (sr.EndOfStream())'line = sr.ReadToEnd()line = sr.ReadLine()
LineCount += 1
End Whilefs.Close()
NextMoveProcessedFiles(
"D:\Test\", "D:\Test1", "Test.txt")End Sub
Sub MoveProcessedFiles(ByVal StrSourceFilePath As String, ByVal StrTargetDir As String, ByVal strFileName As String)Dim oldFile, newFile, TargetDir As StringTryoldFile = StrSourceFilePath + strFileName
TargetDir = StrTargetDir
newFile = TargetDir +
"\" + strFileNameIf Not File.Exists("D:\Test1\" + strFileName) ThentheFile.Close()
File.Delete(newFile)
File.Move(oldFile, newFile)
Dim theFile As FileStream = File.Create("D:\Test1\" + strFileName)End IfCatch ex As Exception'MsgBox(ex.Message)FinallyEnd Try
Access problem while Copying & moving content of a file from one folder to another folder is solved if we use filestream to create a file .
all integers are displayed in hex format during debugging in vb.net
Hi All,
This is an uncommon problem during debugging .
All integer values will be displayed in hex format.
Solution:
While debugging ,right click to get Quickwatch window & in that window right click
and unselect Hexadecimal display.
Subscribe to:
Posts (Atom)