SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["HousingConnectionString"].ConnectionString); SqlCommand com = new SqlCommand("Select First_Name , Middle_Name , Last_Name , Mobile_No , Email, DOB , Age , Education , Office_Add , Native_Add , PAN_Card , Aadhar_Card , Religion , Business_Job , Married_Unmarried , No_Of_Members from Primary_Member where Flat = '" + Request.QueryString["fnum"] + "'", conn); conn.Open(); SqlDataReader dr = com.ExecuteReader(); if (dr.Read()) { TextBoxFN.Text = dr["First_Name"].ToString(); TextBoxMN.Text = dr["Middle_Name"].ToString(); TextBoxLN.Text = dr["Last_Name"].ToString(); TextBoxMO.Text = dr["Mobile_No"].ToString(); TextBoxE.Text = dr["Email"].ToString(); TextBoxDOB.Text = dr["DOB"].ToString(); TextBoxA.Text = dr["Age"].ToString(); TextBoxEQ.Text = dr["Education"].ToString(); TextBoxOA.Text = dr["Office_Add"].ToString(); TextBoxNA.Text = dr["Native_Add"].ToString(); TextBoxPCN.Text = dr["PAN_Card"].ToString(); TextBoxACN.Text = dr["Aadhar_Card"].ToString(); TextBoxR.Text = dr["Religion"].ToString(); TextBoxNOM.Text = dr["No_Of_Members"].ToString(); dr.Close(); conn.Close(); }
string strGender=dt.Rows[0]["Gender"].ToString(); if(strGender=="Male") rbdGender.SelectedIndex=0; else rbdGender.SelectedIndex=1;
datatable
rdbMarried.SelectedIndex = Convert.ToInt32(rdbMarried.Items.IndexOf(rdbMarried.Items.FindByText(dt.Rows[0]["Married"].ToString()))); // as you haven't shared your code, I did it with my assumption // dt is a datatable // Married is a column name
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)