Implement the value of DROPDOWNLIST with DataSet

xiaoxiao2021-03-06  54

Public Sub Page_Load (ByVal sender As System.Object, ByVal e As System.EventArgs) 'to bring up the system name portion dim myConnection As New SqlConnection (ConfigurationSettings.AppSettings ( "ConnectionString")) Dim myCommand As New SqlDataAdapter ( "select * from [ Department] ", myconnection)

DIM DS AS NEW DATASET () MyCommand.Fill (DS, "Department") 'Set the system name assignment to the system setting D_Name.DataSource = DS.TABLES ("Department") D_Name.DataTextField = "d_name" D_Name.DataValuefield = "D_ID" D_Name.Database () MyConnection.Close () End Sub

转载请注明原文地址:https://www.9cbs.com/read-81648.html

New Post(0)