First you need to add columns to this data table:
Dim dt As New DataTable dt.Columns.Add("RName", GetType(String))
Also, I know little about the variables con , cmd and dr2 in your code, but I strongly recommend that you dispose of them correctly:
Dim dt As New DataTable dt.Columns.Add("RName", GetType(String)) Using con As New SqlConnection("connection string to the database") Using cmd = con.CreateCommand() con.Open() cmd.CommandText = "Select Distinct RName from tb_RS_New" Using dr = cmd.ExecuteReader() While (dr.Read()) dt.Rows.Add(dr("RName")) End While End Using End Using End Using
source share