vijay

welcome Netizen

Share Your Knowledge.It is a way to achieve immortality

Thursday, January 20, 2011

Read your file from your harddisk and store into Database



hi....friends

Now in this article you are going to see about to read file from your hard disk and load into database. Article we are using function  streamreader


By using streamreader,and string,readline()  helps to read all the text fromt the file
check this code and try yourself with your own project............



    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click


ProgressBar1.Minimum = 0
        ProgressBar1.Maximum = 1000
        ProgressBar1.Value = 1000
        Dim str As New StreamReader("C:\Users\admin\Desktop\notes.txt")
        Dim text As String
        Dim text2 As String
        text = str.ReadLine()
        Do Until text Is Nothing


            ListBox1.Items.Add(text)
            text = str.ReadLine()
            'If ProgressBar1.Value <= 10000 Then
            ProgressBar1.PerformStep()






        Loop

      

    End Sub

check it and post your comments.....

0 comments:

Post a Comment