c# - Search button function -
i have search button on web page , should return subject name db similar entered search word, please me it...
this c# code
protected void button1_click(object sender, imageclickeventargs e) { mysqlconnection connection = new mysqlconnection("server=localhost; database=e-learningsystem; uid=root; password=123;port=3307;"); connection.open(); string srh = editbox_search.type; try { mysqlcommand cmd = new mysqlcommand("select * subject name='" + srh + "'", connection); } catch { } }
my asp code
<input name="editbox_search" class="editbox_search" id="editbox_search" maxlength="80" type="text" style="background-color: #99ccff; margin-top: 0px;" runat="server" enableviewstate="true" title="search courses:" clientidmode="inherit" dir="ltr" visible="true"/><asp:button id="button1" runat="server" height="26px" text="go" width="32px" />
googling i've found this , this link.
you can use sqldatasource.
Comments
Post a Comment