Click here to Skip to main content
15,896,207 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Another question about Graphics.DrawString Pin
Savas Cilve11-Jan-07 6:08
Savas Cilve11-Jan-07 6:08 
QuestionInsert File Pin
jds120711-Jan-07 3:56
jds120711-Jan-07 3:56 
QuestionWhat??? Pin
CPallini11-Jan-07 4:06
mveCPallini11-Jan-07 4:06 
AnswerRe: Insert File Pin
Dave Kreskowiak11-Jan-07 4:12
mveDave Kreskowiak11-Jan-07 4:12 
GeneralRe: Insert File Pin
Colin Angus Mackay11-Jan-07 4:51
Colin Angus Mackay11-Jan-07 4:51 
GeneralRe: Insert File Pin
Dave Kreskowiak11-Jan-07 4:56
mveDave Kreskowiak11-Jan-07 4:56 
GeneralRe: Insert File Pin
jds120711-Jan-07 6:01
jds120711-Jan-07 6:01 
GeneralRe: Insert File Pin
Dave Kreskowiak11-Jan-07 6:52
mveDave Kreskowiak11-Jan-07 6:52 
jds1207 wrote:
The file that I am cleaning is being cleaned and making the file double spaced.


It's called Validation and you're not doing anything to verify that what you're reading is valid. You're just assuming that what you have in your variables is good and that's why your database is comming up with zeros.

You're going about reading a text file the hard way.
Dim sourceFilename As String = "C:\Scanning files\lsprint_MO.txt"
Dim tempFilename As String = "C:\Scanning files\lsprint_MO_temp.txt"
Dim textline As String
 
If System.Io.File.Exists(sourceFilename) Then
    Try
        Dim sr As New StreamReader(sourceFilename)
        Do
            textline = sr.ReadLine()
 
            ' Why are you using String.Concat??  Your building a line and adding
            ' blank lines to the textline string.  Why??

            ' Parse your line here and make sure that the values you got are VALID!
            ' If not, jump to some other method to report or log the problem.
 
           ' If we get here, the data looks good.  Add it to the database.
            ' Call your database code here and pass the "cleaned" values to it.
        Loop Until textline Is Nothing
 
    Catch ex As Exception
        ' Something happened during the file read or database call.
        ' Log the error or report it somehow and forget the rest of the file.
 
    Finally
        If Not sr Is Nothing Then
            sr.Close()
        End If
    End Try

It would also help to see a sample of the file you're trying to read and parse.



Dave Kreskowiak
Microsoft MVP - Visual Basic


GeneralRe: Insert File Pin
jds120711-Jan-07 7:25
jds120711-Jan-07 7:25 
QuestionWhat does it return? Pin
ashwath197911-Jan-07 3:48
ashwath197911-Jan-07 3:48 
AnswerRe: What does it return? Pin
CPallini11-Jan-07 3:59
mveCPallini11-Jan-07 3:59 
QuestionWhat does it return? Pin
ashwath197911-Jan-07 3:47
ashwath197911-Jan-07 3:47 
QuestionVB.Net Project making Pin
Mayuri Gaikwad11-Jan-07 2:44
Mayuri Gaikwad11-Jan-07 2:44 
AnswerRe: VB.Net Project making Pin
Dave Kreskowiak11-Jan-07 3:11
mveDave Kreskowiak11-Jan-07 3:11 
QuestionI am converting a ActiveX(DSO Framer)control into .Net assembly Pin
indian14311-Jan-07 1:53
indian14311-Jan-07 1:53 
AnswerRe: I am converting a ActiveX(DSO Framer)control into .Net assembly [modified] Pin
Dave Kreskowiak11-Jan-07 3:11
mveDave Kreskowiak11-Jan-07 3:11 
QuestionWhy Startup form may appear behind other programs?? Pin
kindman_nb11-Jan-07 1:48
kindman_nb11-Jan-07 1:48 
AnswerRe: Why Startup form may appear behind other programs?? Pin
Kschuler11-Jan-07 8:57
Kschuler11-Jan-07 8:57 
GeneralRe: Why Startup form may appear behind other programs?? Pin
kindman_nb11-Jan-07 9:30
kindman_nb11-Jan-07 9:30 
GeneralRe: Why Startup form may appear behind other programs?? Pin
nickib5811-Jan-07 10:26
nickib5811-Jan-07 10:26 
GeneralRe: Why Startup form may appear behind other programs?? Pin
kindman_nb11-Jan-07 10:49
kindman_nb11-Jan-07 10:49 
QuestionWant to get into serious programming Pin
Member 294306311-Jan-07 1:25
Member 294306311-Jan-07 1:25 
AnswerRe: Want to get into serious programming Pin
Johan Hakkesteegt11-Jan-07 2:47
Johan Hakkesteegt11-Jan-07 2:47 
QuestionWhen I tried to edit the .il file it is giving the following error Pin
indian14311-Jan-07 0:13
indian14311-Jan-07 0:13 
QuestionDoubt on menu Pin
Badhris10-Jan-07 23:27
Badhris10-Jan-07 23:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.