aic007 Posted April 12, 2007 Share Posted April 12, 2007 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 More sharing options...
pulpfiction Posted April 12, 2007 Share Posted April 12, 2007 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 More sharing options...
aic007 Posted April 12, 2007 Author Share Posted April 12, 2007 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 More sharing options...
jesh Posted April 12, 2007 Share Posted April 12, 2007 I responded to your post in the ASP section. If this is about .NET, we can continue discussion here instead of the ASP forum. Link to comment Share on other sites More sharing options...
aic007 Posted April 13, 2007 Author Share Posted April 13, 2007 Yes sir. Link to comment Share on other sites More sharing options...
Guest lakku Posted May 8, 2007 Share Posted May 8, 2007 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now