View data in DataGrid

R

ruca

I have this code to read a text file (.txt) and fill a dataset and then
filter, using DataView, by user. The final result I want to put into a
datagrig, but this last part is not happen and I don't know why.


the code is below

------------------------------------------------------------------------

LerLinha = New StreamReader(LerPath)

dsMrc = New DataSet
dtMrc = New DataTable("Mrc")
dcMrc = New DataColumn("Cod",
System.Type.GetType("System.String"))
dcMrc = New DataColumn("Data",
System.Type.GetType("System.String"))
dcMrc = New DataColumn("Hora",
System.Type.GetType("System.String"))

dtMrc.Columns.Add("Cod")
dtMrc.Columns.Add("Data")
dtMrc.Columns.Add("Hora")

Do
txtLine = LerLinha.ReadLine()

If Not txtLine Is Nothing Then
Cd = ProcessCod(txtLine)
dtData = ProcessData(txtLine)
dtHora = ProcessHora(txtLine)

drMrc = dtMrc.NewRow()
drMrc("Cod") = Cd
drMrc("Data") = dtData
drMrc("Hora") = dtHora

dtMrc.Rows.Add(drMrc)
End If

'dsMrc.Tables("Mrc").Rows.Add(drMrc)
Loop Until txtLine Is Nothing

dsMrc.Tables.Add(dtMrc)
'dsMrc.Tables("Mrc").Select("Cod='" & FindUser & "'")

Dim strFilter As String
Dim findRows() As DataRow
Dim dtAux As DataTable

Dim v As New DataView
v.Table = dtMrc
v.RowFilter = "Cod=" & FindUser
v.Sort = "Data ASC"
//this is my datagrid
dgMarcacoes.DataSource = v

LerLinha.Close()
LerLinha = Nothing
 
R

ruca

Ok. Thanks

After my post I find out that. :)
Thank you very much anyway for your help

Ruca
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,097
Latest member
RayE496148

Latest Threads

Top