Click here to Skip to main content
15,914,642 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: bindingsource.filter not working Pin
Member 1108983127-Jan-17 4:26
Member 1108983127-Jan-17 4:26 
AnswerRe: bindingsource.filter not working Pin
Richard Deeming27-Jan-17 2:07
mveRichard Deeming27-Jan-17 2:07 
GeneralRe: bindingsource.filter not working Pin
Member 1108983127-Jan-17 4:23
Member 1108983127-Jan-17 4:23 
GeneralRe: bindingsource.filter not working Pin
Richard Deeming27-Jan-17 4:26
mveRichard Deeming27-Jan-17 4:26 
GeneralRe: bindingsource.filter not working Pin
Member 1108983127-Jan-17 7:20
Member 1108983127-Jan-17 7:20 
GeneralRe: bindingsource.filter not working Pin
Richard Deeming27-Jan-17 7:37
mveRichard Deeming27-Jan-17 7:37 
QuestionHow to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Member 1186689324-Jan-17 5:29
Member 1186689324-Jan-17 5:29 
AnswerRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Richard Deeming24-Jan-17 6:02
mveRichard Deeming24-Jan-17 6:02 
You're getting the exception because you've read a line from the file which doesn't contain two commas.

That's probably caused by the fact that you're skipping every other line:
VB.NET
line = sr.ReadLine() ' Read a line
If Not (line Is Nothing) Then
    arrStr = Split(sr.ReadLine, ",") ' Read another line

You need to change that to re-use the line you've already read. You also need to check that the array returned from Split contains enough elements:
VB.NET
line = sr.ReadLine()
If line IsNot Nothing Then
    arrStr = Split(line, ",")
    If arrStr.Length >= 3 Then
        strSiteCode = arrStr(0)
        strVistaFQDN = arrStr(1)
        strPort = arrStr(2)
        ...

You should also move the code that reads the contents of Sites2.txt outside of the loop. As it stands, you're reading the entire file for every line in Sites2.csv, even though you're not changing it.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Member 1186689324-Jan-17 8:13
Member 1186689324-Jan-17 8:13 
GeneralRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Richard MacCutchan24-Jan-17 8:38
mveRichard MacCutchan24-Jan-17 8:38 
GeneralRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Member 1186689324-Jan-17 9:07
Member 1186689324-Jan-17 9:07 
GeneralRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Richard MacCutchan24-Jan-17 9:37
mveRichard MacCutchan24-Jan-17 9:37 
GeneralRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Member 1186689324-Jan-17 10:03
Member 1186689324-Jan-17 10:03 
PraiseRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Member 1186689325-Jan-17 5:42
Member 1186689325-Jan-17 5:42 
GeneralRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Richard MacCutchan25-Jan-17 5:57
mveRichard MacCutchan25-Jan-17 5:57 
GeneralRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Member 1186689324-Jan-17 9:11
Member 1186689324-Jan-17 9:11 
GeneralRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Eddy Vluggen25-Jan-17 6:21
professionalEddy Vluggen25-Jan-17 6:21 
QuestionHow to download all latest files from ftp server to pc automatically in vb.net Pin
Member 1295777522-Jan-17 15:38
Member 1295777522-Jan-17 15:38 
AnswerRe: How to download all latest files from ftp server to pc automatically in vb.net Pin
Michael_Davies22-Jan-17 20:43
Michael_Davies22-Jan-17 20:43 
GeneralRe: How to download all latest files from ftp server to pc automatically in vb.net Pin
Member 1295777522-Jan-17 21:09
Member 1295777522-Jan-17 21:09 
GeneralRe: How to download all latest files from ftp server to pc automatically in vb.net Pin
NotPolitcallyCorrect23-Jan-17 2:20
NotPolitcallyCorrect23-Jan-17 2:20 
QuestionHow to download all latest files from ftp server to pc automatically in vb.net Pin
Member 1295777522-Jan-17 15:07
Member 1295777522-Jan-17 15:07 
QuestionIsolating text within a text box Pin
Member 1296154621-Jan-17 13:27
Member 1296154621-Jan-17 13:27 
AnswerRe: Isolating text within a text box Pin
NotPolitcallyCorrect21-Jan-17 15:13
NotPolitcallyCorrect21-Jan-17 15:13 
Questionvb.net 2010 code check if values exist Pin
dcof19-Jan-17 12:00
dcof19-Jan-17 12:00 

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.