Sorry you wanted
VB (and i forgot the initial variable declartaion):
Private daSql As SqlDataAdapter
Private sqlCmd As SqlCommand
Private sqlConn As SqlConnection
Public Function getDataTable(ByVal sqlCmd as string) as DataTable
Dim dt as new Datatable
sqlConn = New SqlConnection([connectionString])
cmd = New SqlCommand(sqlCmd, sqlConn)
daSql = New SqlDataAdapter(sqlcmd, sqlConn)
daSql.Fill(dt)
Return dt
End Function
Dim dt as New DataTable
Dim sSql as string
sSQL = [SELECT Statement]
dt = getDataTable(sSQL)
For Each dr as DataRow in dt.Rows
drp.Items.Add(new ListItem(dr.item("name"), dr.item("valuecolumn")))
Next
-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
^^Thats my signature