Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
trying to getting value from dropdownlist and press search button and show data on gridview.giving values on dropdownlist is hardcode
C#
//string searchTXt = GridView2.SelectedValue.ToString();
string query = "SELECT * FROM ['ISB VAS Nodes$'] where id='"+DropDownList1.SelectedValue+"'";
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(query, connstring);
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
    GridView2.DataSource = ds;
    GridView2.DataBind();
}
Posted
Updated 19-Apr-13 0:32am
v2
Comments
Karthik Harve 19-Apr-13 6:33am    
[Edit] pre tags added.
Vani Kulkarni 19-Apr-13 6:43am    
WHat is the issue you are facing?
fak_farrukh 19-Apr-13 7:03am    
no error nad also showing nothing
[no name] 19-Apr-13 7:09am    
check the querry in sql then u will know why the problem is occuring ..........

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900