d2005,
Sorry, I posted the above without two necessary settings, here is a fully working snippet
VB Code:
oSQLConn.Open() Dim cmd As New SqlCommand cmd = New SqlCommand("SELECT c_msg_default, c_msg_custom1, c_msg_custom2 As ThreeFields FROM tb_comp_detail WHERE (c_companycode = '" & lblUser.Text & "')", oSQLConn) Dim dr As SqlDataReader dr = cmd.ExecuteReader With myDDL ' change this to whatever your DDL is called .DataSource = dr [b].DataTextField = "ThreeFields" .DataValueField = "ThreeFields"[/b] .DataBind() End With dr.Close()




Reply With Quote