database
generate code for retrieving data from access to dropdownlist using asp.net
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pankaj GuptaPosted Dec 17, 2008, 7:21 AM
You can generally write the code to get it from access and bind it with the drop down list. set the properties. if you require exact code plz provide the whole details so that we can help you.
Rajendra DeopuraPosted Dec 13, 2008, 3:56 AM
Dear
Create a table in access with three fields:
a. accno
b. name
c. balance
Create a temporary dataset with one method : GetAccountHolders()
Write The following code in Page Load:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim adapter As New DataSet1TableAdapters.bankinfoTableAdapter
Dim dt As DataTable = adapter.GetAccountHolders()
DropDownList1.DataSource = dt
DropDownList1.DataTextField = "Name"
DropDownList1.DataValueField = "accno"
DropDownList1.DataBind()
End Sub
Import the namespaces
a. System.Data
b. System.Data.OLEDB
Thanks