forum

Home / DeveloperSection / Forums / Getting value from SQL query to textbox

Getting value from SQL query to textbox

Anonymous User 2410 28-Aug-2014
Protected Sub Button3_Click(ByVal sender As Object, ByVal e
As System.EventArgs) Handles Button3.Click
    Dim cons, query As String
    Dim con As OdbcConnection
    Dim adpt As OdbcDataAdapter
    'Dim num As Integer
    cons = "dsn=Courier; UID=Courier; PWD=123;"
    con = New OdbcConnection(cons)
    con.Open()
    query ="select Name from EMPLOYEE where EMPLOYEE_ID=" +DropDownList1.SelectedValue
    Dim ds As DataSet
    adpt = New OdbcDataAdapter(query, con)
    ds = New DataSet
    adpt.Fill(ds,"Courier")
    ' TextBox1.Text =ds
    con.Close()
End Sub

I want to display the name of the employee in Textbox whoos ID is specified in query, what can I do for that?


Updated on 06-Jul-2023
I am a content writter !

Can you answer this question?


Answer

2 Answers

Liked By