private void formloaddata()
{
SqlDataReader read
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString01"].ConnectionString);
conn.open
string strquery = "Select UserID,Username,Password,Fullname,Surname,Email Address,Country,Province from "Write your TableName"";
SqlCommand cmd=new SqlCommand(strquery,conn);
read = cmd.ExecutenonQuery();
if read.hasrows
{
read.Read();
textbox1.text=read("UserID");
textbox2.text=read("Username");
textbox3.text=read("Password");
textbox4.text=read("Fullname");
textbox5.text=read("Surname");
textbox6.text=read("Email ");
textbox7.text=read("Address");
textbox8.text=read("Country");
textbox9.text=read("Province");
}
}
write the code in a try catch block so if error occurs you will come to know what the error is