You are here: DEVPPL Forum Programming Visual Basic Forum
NOTIFICATIONS
54.093
MEMBERS
15.688
TOPICS
62.262
POSTS
  562
FLASH GAMES
7.740
TUTORIALS
 

Login

E-mail:
Password:

visual basic 2010 express - using linq query

0

Loading

visual basic 2010 express - using linq query

Postby Jdwbasic » Fri May 20, 2011 4:09 pm

Hi,
First off, I am a newbie programmer. I am trying to print an array to a text file. The array gets its data from a linq query using .toArray. The problem is that instead of the data from the query being written to the file, what I get in the file is this:
VB$AnonymousType_5`4[System.String,System.String,System.String,System.String][]

Here is the code snippet:

Dim search As String

search = InputBox("Enter search string")

If File.Exists("MyData.txt") Then
Dim myfile() As String = File.ReadAllLines("MyData.txt")
Dim query1 = From line In myfile
Let data = line.Split(","c)
Let iname = data(0)
Let idescrip = data(1)
Let ilocation = data(2)
Let ivalue = FormatCurrency(data(3))
Where search <> iname
Select iname, idescrip, ilocation, ivalue


Dim newFile() = query1.ToArray
lstDisplay.Items.Add(newFile)
Dim myfile2 = File.CreateText("MyData.txt")
Dim outputLine = newFile

myfile2.writeline(outputLine)
myfile2.Close()


Any help would be greatly appreciated!
:mrgreen:
Jdwbasic
 
Reputation: 0
Posts: 2
Joined: Fri May 20, 2011 4:00 pm
Highscores: 0
Arcade winning challenges: 0

visual basic 2010 express - using linq query - Sponsored results

Sponsored results

Login to get rid of ads

 

^ Back to Top