473,394 Members | 1,811 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

View data in DataGrid



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
------------------------------------------------------------------------
Could you help me????
--

Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
Nov 18 '05 #1
2 864
You must use dgMarcacoes.DataBind() after dgMarcacoes.DataSource = v
"ruca" <ru***@iol.pt>, iletide şunu yazdı
news:eM**************@TK2MSFTNGP09.phx.gbl...


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
------------------------------------------------------------------------
Could you help me????
--

Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

Nov 18 '05 #2
Ok. Thanks

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

Ruca

"Selen" <sk*****@yahoo.com> escreveu na mensagem
news:ub**************@TK2MSFTNGP11.phx.gbl...
You must use dgMarcacoes.DataBind() after dgMarcacoes.DataSource = v
"ruca" <ru***@iol.pt>, iletide şunu yazdı
news:eM**************@TK2MSFTNGP09.phx.gbl...


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
------------------------------------------------------------------------
Could you help me????
--

Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris Mullins | last post by:
I'm building a GUI that needs to be able to view a large amount of text arranged in rows. Large being anywhere from a few hundred lines through a few hundred thousand. I need a way to "cap" the max...
4
by: Souri Challa | last post by:
Hello All, When a datagrid in a web form is getting re populated from view state on post back, it is firing the datagrid Item Created event but the DataGridItem(e.Item.DataItem is null) in the...
6
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp;...
2
by: Chris Mullins | last post by:
I'm building a GUI that needs to be able to view a large amount of text arranged in rows. Large being anywhere from a few hundred lines through a few hundred thousand. I need a way to "cap" the max...
4
by: cmuraz | last post by:
hi im using oracle forms 6i. i need to view a pdf in oracle forms runtime window itself the pdf name will differ depending on the previous parameter. i need to show the pdf in an object in the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.