Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
App. WinForms / WPF .NET
[VB.NET] data view e datagrid
venerdì 23 settembre 2005 - 15.23
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
redman83
Profilo
| Newbie
16
messaggi | Data Invio:
ven 23 set 2005 - 15:23
Salve, vorrei sapere come posso visualizzare in un datagrid le righe presenti in un datatable.
Ho visto che bisognerebbe passare per un dataview.
2. come posso confrontare le righe presenti nella datatable1 con le righe presenti nella datatable2?
riga x riga intendo.
grazie mille!
Cteniza
Profilo
| Guru
1.509
messaggi | Data Invio:
ven 23 set 2005 - 15:45
1) associ il dataview al datagrid
2) estrai le righe dal datable 1
per ogni riga datatable 1 fai una select su datatable 2 con la stessa chiave e confronti i campi
redman83
Profilo
| Newbie
16
messaggi | Data Invio:
ven 23 set 2005 - 15:47
capisco ma come faccio praticamente?
uno spunto...
Cteniza
Profilo
| Guru
1.509
messaggi | Data Invio:
ven 23 set 2005 - 16:13
1) Metti dataview sulla form
imposta la datasource della datagrid sulla dataview
2) naturalmente è solo uno spunto da sviluppare
Dim dr As DataRow
For Each dr In mytable1.Rows
dim s As String = ctype(dr("ID"),String)
dim dw() As DataRow = myTable2.Select("ID = " & s)
if not dw is nothing andalso dw.Length <> 0 then
dim k as integer
dim c as string
for k = 0 to mytable1.Columns.Count - 1
c = mytable1.Columns(k).ColumnName
if ctype(dw(0)(c),string) <> ctype(dr(c),string) then
'diverso
end if
next
Else
'manca
end if
Next
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !