Cara membuat dropdownlist VB.Net atau ASP.Net

Private Sub DropDownKAjaran()

Dim constr As String = ConfigurationManager.ConnectionStrings(“Conn”).ConnectionString
Using con As New SqlConnection(constr)
Using cmd As New SqlCommand(“select kdtahun, NamaTahun + ‘ Semester ‘ + Semester as TahunSemester From TahunNilai order by kdtahun desc“)
cmd.CommandType = CommandType.Text
cmd.Connection = con
con.Open()
ddlthnajar.DataSource = cmd.ExecuteReader()
ddlthnajar.DataTextField = “TahunSemester
ddlthnajar.DataValueField = “kdtahun
ddlthnajar.DataBind()
con.Close()
End Using
End Using
‘ddlthnajar.Items.Insert(0, New ListItem(“–Pilih Tahun Ajaran–“, “”))

End Sub

 

warna merah silahkan kalian sesuaikan dengan kebutuhan masing-masing.

Cara Daftar Google Adsense Indonesia Agar Cepat Diterima

Google Adsense adalah salah satu program PPC (Pay Per Click) yang paling banyak digemari oleh ...

Learn more
Share This:Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPin on Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *