Click here to Skip to main content
15,900,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have 20 textboxes in my webform and and my insert update delete buttons are working.
data is saving into the datatable. i am using three tier architecture.
now i want when i enter id inside txtid textbox control so rest of fields which is related from the datarow should be automatically come inside the all textboxes...
Posted
Comments
PIEBALDconsult 9-Aug-15 13:50pm    
What's stopping you?

1 solution

By means of autopostback u can achieve this.. its totally very simple.
The textbox u want to put the id..
Add autopostback="true"
Then on design view , click the textbox it take u to code behind..
On this
Public void txtboxid_selectedchanged(sender arg)
{
WRITE THE QUERY to COLLECT the datum related to the id FROM DATAREADER..
Or
Type of the procedure to collect the datas
AND ASSIGN THE VALUES TO THE OTHER TEXTBOX..
LIKE..
txtname.Text=datareader's[0].value.
Txtphone.Tex t=datareader's[1]value
}
Use this concept it will definitely help's u.
U can get the value from datareader or dataset. As ur wish.
Go through that how to assign the value after getting the values..

After done althose this done.. enter the id or data u need to derive from the database ,and one click on outside the textbox.. if u need without any click go with delay code on code behind:-)
 
Share this answer
 
v6

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900