Re: How to Import table from Access to Datagridview using VB2010 in customized format
Hi,
Thanks for replying. I have listed my code which i have tried so far.
Public Class frmMainForm
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DataGridView1.Rows.Add(New Object() {"aleksy", "Rugby"})
DataGridView1.Rows.Add(New Object() {"aleksander", "football"})
DataGridView1.Rows.Add(New Object() {"aleksy", "hurtles"})
DataGridView1.Rows.Add(New Object() {"bazyli", "baseball"})
DataGridView1.Rows.Add(New Object() {"aleksander", "car racing"})
DataGridView1.Rows.Add(New Object() {"bazyli", "boxing"})
DataGridView1.Rows.Add(New Object() {"bazyli", "cricket"})
DataGridView1.Rows.Add(New Object() {"grzegorz", "volleyball"})
cboNames.DataSource = _
( _
From row In DataGridView1.Rows.Cast(Of DataGridViewRow)() _
Where Not row.IsNewRow _
Select Name = CStr(row.Cells("Column1").Value) Distinct Order By Name
).ToList
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Rows = _
( _
From row In DataGridView1.Rows.Cast(Of DataGridViewRow)() _
Where Not row.IsNewRow AndAlso CStr(row.Cells("Column1").Value) = cboNames.Text _
Select Name =
CStr(row.Cells("Column1").Value),
Sport = CStr(row.Cells("Column2").Value) Order By Name).ToList
Dim f As New frmChildForm
Try
f.DataGridView1.Rows.Clear()
For Each row In Rows
f.DataGridView1.Rows.Add(New Object() {row.Name, row.Sport})
Next
f.ShowDialog()
Finally
f.Dispose()
End Try
End Sub
End Class
Please help me on this......
your reply would be much precious.
Originally Posted by dglienna
What have you actually TRIED? Post the code (with tags [see below] )'
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.