Jump to content

Problems with textbox.


aic007
 Share

Recommended Posts

Hi.I'm very new with ASP.NET and C#, so I thought I could ask some experts here for help :) I was wondering if sombody here could tell me what to do in order to get one or more textboxes to retrieve information automaticly ?For instance, if I type in the employee nr, I want the name and adress textboxes to be filled in automaticly. I really don't know how to do it. Can somebody plzz help me or show me some examples ?

Link to comment
Share on other sites

First of all you will need a database to store all the employee information.... so when the user types the number then you can get the corresponding user information. so you need to decide on some database and get employee info. then learn ASP.NET/C# connectivity [with database]. query database and retrieve data. finally populate textbox with that data.ASP.NET & DB Conection.http://www.w3schools.com/aspnet/aspnet_dbconnection.asp

Link to comment
Share on other sites

Hi. Thanx for replying. I have a database to store employee information. I also know how to connect to database and get data from database in a text box. What I still don't know is how to get other tetxfields to be filled automaticly when i have typed the employee nr and pressed enter.Googled a lot, can't find any examples that can help me :)

Link to comment
Share on other sites

  • 4 weeks later...
Guest lakku
Yes sir.
Private Sub btn_submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_submit.Click st = "select * from employeetable where( employee nr='" & textbox1.text & "')" comm = New OleDbCommand(st, cn) dr = comm.ExecuteReader If dr.Read() = True Then textbox2.Text = dr("employeename") textbox3.Text = dr("employeeid") textbox4.Text = dr("features") textbox5.Text = dr("address") Else Label1.Visible = True End If dr.Close() End Sub
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...