Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
how to pass values from textbox to listbox in asp.net c# and when i run one query in textbox,how to show their query output in listbox
Posted

1 solution

 
Share this answer
 
Comments
Member 10918596 6-Feb-15 5:11am    
when i put one query in textbox,how to show their query output in listbox
/\jmot 6-Feb-15 5:16am    
just use textbox value(textbox1.text.tostring()) as a sqlquery and run it, get the output and bind to listbox.
thats all.
Member 10918596 6-Feb-15 5:16am    
when i put one query in textbox and click button then how to show their query output in listbox in asp.net c#
Member 10918596 6-Feb-15 5:19am    
con = new SqlConnection(strcon);
con.Open();
SqlCommand cmd = new SqlCommand("sp_query", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@query_name",txt_query_name.Text);
cmd.Parameters.AddWithValue("@queries",txt_query.Text);
cmd.ExecuteNonQuery();
con.Close();
Member 10918596 6-Feb-15 5:20am    
above code is insert command and when i put one query in textbox and click button then how to show their query output in listbox in asp.net c#

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