R
ruca
Hi gurus,
How can I filter data in my DataSet and then put the result in a DataGrid?
NOTE: I'm reading a txt file into a dataset with 3 columns:
Id, Name, Age
I have this:
code------------------------------------------------------------------------
-----------------------
LerLinha = New StreamReader(LerPath)
dsMrc = New DataSet
dtMrc = New DataTable("Mrc")
dcMrc = New DataColumn("Id",
System.Type.GetType("System.String"))
dcMrc = New DataColumn("Name",
System.Type.GetType("System.String"))
dcMrc = New DataColumn("Age",
System.Type.GetType("System.String"))
dtMrc.Columns.Add("Id")
dtMrc.Columns.Add("Name")
dtMrc.Columns.Add("Age")
dsMrc.Tables.Add(dtMrc)
Do
txtLine = LerLinha.ReadLine()
drMrc = dtMrc.NewRow()
drMrc("Id") = ProcessId(txtLine) 'FindUser
drMrc("Name") = ProcessName(txtLine)
drMrc("Age") = ProcessAge(txtLine)
dtMrc.Rows.Add(drMrc)
dsMrc.Tables("Mrc").Rows.Add(drMrc)
Loop Until txtLine Is Nothing
Dim strFilter As String
strFilter = "Id=" & FindUser
dsMrc.Tables("Mrc").Select(strFilter)
dgMarcacoes.DataSource = dsMrc
LerLinha.Close()
LerLinha = Nothing
code------------------------------------------------------------------------
How can I filter data in my DataSet and then put the result in a DataGrid?
NOTE: I'm reading a txt file into a dataset with 3 columns:
Id, Name, Age
I have this:
code------------------------------------------------------------------------
-----------------------
LerLinha = New StreamReader(LerPath)
dsMrc = New DataSet
dtMrc = New DataTable("Mrc")
dcMrc = New DataColumn("Id",
System.Type.GetType("System.String"))
dcMrc = New DataColumn("Name",
System.Type.GetType("System.String"))
dcMrc = New DataColumn("Age",
System.Type.GetType("System.String"))
dtMrc.Columns.Add("Id")
dtMrc.Columns.Add("Name")
dtMrc.Columns.Add("Age")
dsMrc.Tables.Add(dtMrc)
Do
txtLine = LerLinha.ReadLine()
drMrc = dtMrc.NewRow()
drMrc("Id") = ProcessId(txtLine) 'FindUser
drMrc("Name") = ProcessName(txtLine)
drMrc("Age") = ProcessAge(txtLine)
dtMrc.Rows.Add(drMrc)
dsMrc.Tables("Mrc").Rows.Add(drMrc)
Loop Until txtLine Is Nothing
Dim strFilter As String
strFilter = "Id=" & FindUser
dsMrc.Tables("Mrc").Select(strFilter)
dgMarcacoes.DataSource = dsMrc
LerLinha.Close()
LerLinha = Nothing
code------------------------------------------------------------------------