i created one table EmpReg in sql server 2000 which contain details of Employer..Nw i want to show allthe fields in a form wen the aspx form get loaded so i wrote this code in( asp.net using C#) one form . bt i can't view the details wen page get loaded plz help
thank you
code-
public partial class Employeeregupdate2 : System.Web.UI.Page
{
Class1 c = new Class1();
string ud;
protected void Page_Load(object sender, EventArgs e)
{
ud = c.generatestringid("Eid", "EmployeeReg", "E");
if (!IsPostBack)
{
try
{
c.dr = c.procexecutereader("Select Name,UserName,Password,Companyname,Constitution,Industrytype,Contactperson,
Desigination,TotalEmployee,Fulladdress,City,State,Pin,Email,Phoneno,Mob,website from EmployeeReg where Eid= '" + ud + "'");
if (c.dr.Read())
{
txtname.Text = c.dr[0].ToString();
txtusername.Text = c.dr[1].ToString();
txtpwd.Text = c.dr[2].ToString();
txtcompanyname.Text = c.dr[3].ToString();
txtconstitution.Text = c.dr[4].ToString();
txtindustrytype.Text = c.dr[5].ToString();
txtcontctperson.Text = c.dr[6].ToString();
txtdesigination.Text = c.dr[7].ToString();
txttotalemp.Text = c.dr[8].ToString();
txtfulladress.Text = c.dr[9].ToString();
txtcity.Text = c.dr[10].ToString();
txtstate.Text = c.dr[11].ToString();
txtpin.Text = c.dr[12].ToString();
txtemail.Text = c.dr[13].ToString();
txtphoneno.Text = c.dr[14].ToString();
txtmob.Text = c.dr[15].ToString();
txtwebsite.Text = c.dr[16].ToString();
}
else
{
Label1.Visible = true;
Label1.Text = "no records";
}
}
catch (Exception ex)
{
Label1.Visible = true;
Label1.Text = ex.Message;
}
}
}
}