how to write serch in database

Posted by chirivellaphaniraja-14771 under ASP.NET on 4/5/2012 | Points: 10 | Views : 828 | Status : [Member] | Replies : 2
Hi to all how to write search in database suppose if u choose the key skills in radio button it will be display only key skills

and if u choose the all the resumes in radio button then it will display only all the resumes.

please give me answer urgent

Thanks to all




Responses

Posted by: Self-Innovator on: 4/5/2012 [Member] Bronze | Points: 25

Up
0
Down
 <table align="center">

<tr>
<td>Enter Country Name</td>
<td><asp:DropDownList ID="ddlSearchCountry" runat="server"></asp:DropdownList></td>
</tr
</table>

on ddlCountry Selected index change Event write this code...
cnn = new SqlConnection(Conn);
cmd = new SqlCommand("Selesp_GetStates",cnn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@CountryCode", CountryCode);
ada = new SqlDataAdapter(cmd);
ds = new DataSet();
GvCountrys.DataSource=ds;
gvCountrys.DataBind();

Join Hands Change lives
Thanks & Regards
Straight Edge Society

chirivellaphaniraja-14771, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sriramnandha on: 5/23/2012 [Member] Starter | Points: 25

Up
0
Down
 protected void Button2_Click(object sender, EventArgs e)

{
if (RadioButton1.Checked==true && RadioButton1.Text == "FIRST")
{
string connectionstring = "connectionstring";

SqlConnection con = new SqlConnection(connectionstring);
string sqlinsert = "select * from myradio where studylist='" + Radiobutton1.Text + "'";
sqldataadapter adp=new sqldataadapter(sqlinsert,con)
dataset ds=new dataset();
adp.fill(ds);
gridview.datasource=ds
gridview.databind();
}
else
{

string connectionstring = "connectionstring";

SqlConnection con = new SqlConnection(connectionstring);
string sqlinsert = "select * from myradio where studylist='" + Radiobutton2.Text + "'";
sqldataadapter adp=new sqldataadapter(sqlinsert,con)
dataset ds=new dataset();
adp.fill(ds);
gridview.datasource=ds
gridview.databind();

}
}
}


}



HOPE THIS WILL HELP

REGARDS


sriram

chirivellaphaniraja-14771, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response