Hey All,
I have loaded CSV data into a dataset, but I'm not sure how to query this dataset with SQL, is it possible?
TIA.
_Dodger.
Printable View
Hey All,
I have loaded CSV data into a dataset, but I'm not sure how to query this dataset with SQL, is it possible?
TIA.
_Dodger.
You do something like this
Hope that helps.VB Code:
Dim rows() as DataRow = MyDS.Table("myTable").Select(SQL statement here)
Hi DevGrp,
Here is my code, it seems to be selecting the correct number of rows, but all data is null, I'm obviously doing something wrong (new to .NET). Please assist if you can.
TIA.Code:Dim fxDataSet As New Data.DataSet()
Dim fxTable As New DataTable()
Dim fxFile As StreamReader = New StreamReader("C:\_Trading\History\25-06-03_02-09-03.txt")
With fxTable.Columns
.Add("Date")
.Add("Price")
End With
While fxFile.Peek <> -1
fxTable.Rows.Add(Split(fxFile.ReadLine, ",", , CompareMethod.Text))
End While
Dim rows() As DataRow = fxTable.Select("Units = ' 150'")
fxTable.Clear()
Dim i As Integer
For i = 0 To rows.GetUpperBound(0)
fxTable.Rows.Add(rows(i))
Next
fxDataSet.Tables.Add(fxTable)
DataGrid1.DataSource = fxDataSet
TextBox1.Text = fxDataSet.Tables(0).Rows.Count()
_Dodger.
If you are doing it like that, then you can just use a DataView. I'll post some code when I get home.
Thanks DevGrp! I think I have it working correctly.
;)