protected void Page_Load(object sender, EventArgs e)
{
string con_str = @"data source=RAJAT-VAIO\SQLEXPRESS;Initial Catalog=rahul;integrated security=true";
int value = 3;
SqlConnection con = new SqlConnection(con_str);
SqlCommand cmd = new SqlCommand("select Q.no,Question,a),b),c),d) from questions where Q.no= @x",con);
cmd.Parameters.AddWithValue("@x", value);
cmd.Connection = con;
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
while(dr.Read())
{
TextBox1.Text = dr["Question"].ToString();
}
dr.Close();
con.Close();
}}
is the above co ...
Go to the complete details ...