Click here to Skip to main content
15,921,643 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: HELP WITH PRINTING MARGINS PLS READ! Pin
vbbeg12-Jan-07 5:11
vbbeg12-Jan-07 5:11 
GeneralRe: HELP WITH PRINTING MARGINS PLS READ! Pin
Dave Kreskowiak12-Jan-07 6:28
mveDave Kreskowiak12-Jan-07 6:28 
GeneralRe: HELP WITH PRINTING MARGINS PLS READ! Pin
vbbeg12-Jan-07 6:44
vbbeg12-Jan-07 6:44 
GeneralRe: HELP WITH PRINTING MARGINS PLS READ! Pin
Dave Kreskowiak12-Jan-07 12:15
mveDave Kreskowiak12-Jan-07 12:15 
GeneralRe: HELP WITH PRINTING MARGINS PLS READ! Pin
vbbeg13-Jan-07 6:12
vbbeg13-Jan-07 6:12 
GeneralRe: HELP WITH PRINTING MARGINS PLS READ! Pin
Dave Kreskowiak15-Jan-07 5:36
mveDave Kreskowiak15-Jan-07 5:36 
GeneralRe: HELP WITH PRINTING MARGINS PLS READ! Pin
vbbeg16-Jan-07 3:24
vbbeg16-Jan-07 3:24 
QuestionAnyone know any good resources on developing right-click/context menus for form controls??? Pin
Joey Picerno11-Jan-07 5:41
Joey Picerno11-Jan-07 5:41 
AnswerRe: Anyone know any good resources on developing right-click/context menus for form controls??? Pin
Kschuler11-Jan-07 9:07
Kschuler11-Jan-07 9:07 
QuestionAnother question about Graphics.DrawString Pin
Savas Cilve11-Jan-07 4:10
Savas Cilve11-Jan-07 4:10 
AnswerRe: Another question about Graphics.DrawString Pin
Dave Kreskowiak11-Jan-07 4:15
mveDave Kreskowiak11-Jan-07 4:15 
GeneralRe: Another question about Graphics.DrawString Pin
Savas Cilve11-Jan-07 4:23
Savas Cilve11-Jan-07 4:23 
GeneralRe: Another question about Graphics.DrawString Pin
Dave Kreskowiak11-Jan-07 5:37
mveDave Kreskowiak11-Jan-07 5:37 
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 

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.