' Take distinct values from a column and return them as datatable ' expO1 Dataset ' expC1 Table ' Optional ' Default is Temp ' expC2 Column name Public Function DistinctValue(ByVal toDataSet As DataSet, _ Optional ByVal tcTable As String = "Temp", _ Optional ByVal tcColumn As String = "") As Boolean Dim lcColumnArray As String = "" lcColumnArray = tcColumn Try oDataTable = toDataSet.Tables(tcTable).DefaultView.ToTable(tcTable, True, lcColumnArray.ToCharArray) Catch loError As Exception DataError(loError, oApp.Debug(loError.Message)) Return False End Try Return True End FunctionSo, at this point, I have a datatable. I am not sure how to move from here to a dataset in order to execute your command.