Regarding data from table to a textbox.

Closed
Ankit - Nov 17, 2011 at 11:02 PM
 Blocked Profile - Nov 18, 2011 at 12:06 AM
Hi
this is my cose.my table is sign_up and i wanna get fetched the record of tht table in to textboxes.how can I do that


protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button2_Click(object sender, EventArgs e)
{
DataSet ds = new DataSet();
string query = ("select * from sign_up where emp_code='" + TextBox1.Text + "' ");
SqlConnection con = new SqlConnection("Data Source=192.168.87.229;Initial Catalog=test;User ID=sa;Persist Security Info=False");
SqlCommand cmd = new SqlCommand(query, con);
SqlDataAdapter adp = new SqlDataAdapter(cmd);
con.Open();
adp.Fill(ds);
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
}


protected void Button1_Click(object sender, EventArgs e)
{

}
protected void TextBox2_TextChanged(object sender, EventArgs e)
{

}
Related:

1 response

Blocked Profile
Nov 18, 2011 at 12:06 AM
Greetings,

Please, bare in mind that before any answer given on the forum, you should know that there are volunteers who give their time trying to solve user problems. They do have a life other than this forum including me.

Therefore, it is specifically requested from Kioskea forum users to show their respect. For this, the use of polite expressions is a minimum.
https://ccm.net/apps-sites/internet-archeology/ccm/10131-terms-of-use-for-ccm-respect-for-others/#politesse

To say please, thank you, appreciate, grateful, etc... is common courtesy when you want something, especially help!

You must copy, modify and repost your message respecting the politeness charter.

We trust that you understand.

Moderator
0