hi
please help me in my project i want to insert the value selected from drop down list into an column in my database using the asp.net in visual studio
[EDIT - OP code from comments]
i use this code to define the droplist
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim cn As OleDbConnection = New OleDbConnection()
cn.ConnectionString = ("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Users\user\Desktop\web programming\\IULWebInformationSystem1\IULWebInformationSystem1\\App_Data\IUlDB.accdb;Persist Security Info=True")
Dim ad As OleDbDataAdapter = New OleDbDataAdapter("Select Nationality From Nationality where Nationality=", cn)
Dim dt As DataTable = New DataTable()
ad.Fill(dt)
NationalityDropList.DataValueField = "Nat_ID"
NationalityDropList.DataTextField = "Nat_ID"
NationalityDropList.DataBind()
and this to insert the data
Protected Sub NextBtn_Click(ByVal sender As Object, ByVal e As EventArgs) Handles NextBtn.Click
con = New OleDbConnection
con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Users\user\Desktop\web programming\\IULWebInformationSystem1\IULWebInformationSystem1\App_Data\IUlDB.accdb;Persist Security Info=True"
con.Open()
sqlquery = "insert into Teacher values ('" & txtid.Text & "','" & FirstNameTxtBox.Text & "','" & MiddelNameTxtBox.Text & "','" & LastNameTxtBox.Text & "','" & txtBD.Text & "','" & POBTxtBox.Text & "','" & NationalityDropList.SelectedValue & "','" & Gendrplist.SelectedValue & "')"
cmd = New OleDbCommand(sqlquery, con)
cmd.ExecuteNonQuery()
con.Open()
txtid.Text = ""
FirstNameTxtBox.Text = ""
MiddelNameTxtBox.Text = ""
LastNameTxtBox.Text = ""
txtBD.Text = ""
POBTxtBox.Text = ""
NationalityDropList.SelectedValue = ""
Gendrplist.SelectedValue = ""