asp.net - Search using textbox value, then displaying it in gridview -


now i'm trying make page supposed display search result in datagrid view, page looks this:

here's stored procedure

alter procedure [dbo].[msproject_select] 

projectcode varchar(50) begin set nocount on;

  select [projectcode]         ,[projectname]   master..[ms_project]   [projectcode] '%' + @projectcode + '%'   order [projectcode] asc 

end

the textbox in aspx page:

 <td align="left" width="200px">                         <asp:textbox id="tbprojectcode" runat="server" width="194px"></asp:textbox>                     </td> 

the search button in aspx page:

 <td align="center" width="25px">                         <asp:imagebutton id="btnsearch" runat="server" imageurl="../support/image/magnifierglass.png"                             width="75%" height="75%" onclientclick="opennewwin();return false;" />                     </td> 

and datagrid in aspx page:

<td>   <asp:panel id="paneldgv" runat="server" height="100%" scrollbars="none" width="100%">   <asp:gridview id="dgv" runat="server" autogeneratecolumns="false" gridlines="none"            allowpaging="true" pagesize="2" cssclass="mgrid" pagerstyle-cssclass="pgr" alternatingrowstyle-cssclass="alt">                         <columns>   <asp:boundfield datafield="projectcode" headertext="project code" />   <asp:boundfield datafield="projectname" headertext="project name" />   <asp:buttonfield buttontype="image" imageurl="../support/image/edit.png" itemstyle-horizontalalign="center" commandname="cmdsearch" headertext="edit">   <itemstyle horizontalalign="center"></itemstyle>          </asp:buttonfield>     </columns>   <pagerstyle cssclass="pgr"></pagerstyle>  <alternatingrowstyle cssclass="alt"></alternatingrowstyle>          </asp:gridview>      </asp:panel> 

how can supposed it? idea when type want click button, stored procedure run , result display in datagrid view, far try no result, can help? thank you.

you should have event handler on button runs stored procedure , binds resulting data gridview.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -