automatically load data from database and display in textbox on form load


  • i want to load data from database and display on the text fields on my form..the data should get fetched from the db without any button click event on form but instead it should get fetched as soon as form is loaded and all the components(like textbox,label etc) gets displayed..i tried writing a function and calling it after InitializeComponent(); method but it is not working..

    is there any way i can load data and display it on textbox automatically on form_load?

    or can i have a hidden button which will fire automatically when the form is loaded?

    Saturday, March 29, 2014 6:24 PM