Baiju EP
<asp:Dropdownlist id="atMyDropDownList" DataValueField = "veheqpt" DataTextField = "slno" runat="server" /> private Sub Page_Load(Sender as object, e as System.EventArgs) dim sqlText as string = "select * from menu" atMyDropDownList.DataSource = GetDr( sqlText ) atMyDropDownList.DataBind() End Sub private Function GetDr(sqlText as string) as SqlDataReader dim dr as SqlDataReader dim sqlConn as SqlConnection = new SqlConnection(ConnectionString()) dim sqlCmd as SqlCommand = new SqlCommand(sqlText,sqlConn) sqlCmd.Connection.Open() dr = sqlCmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection) return dr End Function
Best Regards, VG www.TeacherJi.com
Login to post response