dt = Grid.DataSource; dt.DefaultView.ToTable(true, new string[] { "Column1" });
Using conn As New SqlConnection(SqlConnString) conn.Open() Using comm As New SqlCommand("SELECT Distinct [ItemNo] FROM [" & LiveDBName & "].[dbo].[Groups]", conn) Using reader As SqlDataReader = comm.ExecuteReader() theTable.Load(reader) conn.Close() End Using End Using End Using
Dim distinctCount As Int32 = From r In dgv1.Rows _ Let rw = CType(r, DataGridViewRow) _ Where Not rw.IsNewRow _ Select rw.Cells(0).Value _ Distinct.Count
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)