Hi
here is Stored procedure
create procedure test
@id int
As
begin
SET NOCOUNT ON;
SELECT (FirstName+' '+LastName) as name,age from Store where id=@id
END
And write this code on the button click
protected void Button1_Click(object sender, EventArgs e)
{
Sqlconnection con=new SqlConnection("Your con string");
Sqlcommand cmd=new SqlCommand("test",con);
cmd.CommandType=CommandType.StoredProcedure;
SqlParameter[] param = new SqlParameter[1];
param[0]=new SqlParameter("@id", SqlDbType.Int);
param[0].value=TextBox1.text;
cmd.parameters.addRange(param);
SqlDataReader dr=cmd.ExecuteReader();
con.open();
while(dr.read())
{
TextBox2.Text=Convert.Tostring(dr["name"]);
TextBox3.Text=Convert.Tostring(dr["age"]);
}
con.close();
}