|  | Posted by kevin on 06/14/94 12:00 
Hi, i'm new to mssql, i've come from php/mysql.. anyway, i'm using SQLServer 2005.. I've connected to the DB using dreamweaver and
 sucessfully displayed a recordset on a page as follows:
 
 
 <%@ Page Language="VB" ContentType="text/html"
 ResponseEncoding="utf-8" %>
 <%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
 Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=blahblahblah,culture=neutral"
 %>
 <MM:DataSet
 id="CosNums"
 runat="Server"
 IsStoredProcedure="false"
 ConnectionString='<%#
 System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_kev")
 %>'
 DatabaseType='<%#
 System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_kev")
 %>'
 CommandText='<%# "select distinct SL.CustomerAccountName,
 SL.CustomerAccountNumber, SIC.documentno, SOP.documentdate,
 SOP.AnalysisCode4 from dbo.SLCustomerAccount SL, dbo.SOPorderReturn
 SOP, dbo.SOPOrderReturnLine SOPL, dbo.SOPInvoiceCredit SIC,
 dbo.SOPInvoiceCreditLine SICL WHERE SOP.CustomerID =
 SL.SLCustomerAccountID AND SOP.SOPOrderReturnID =
 SOPL.SOPOrderReturnID AND SOPL.SOPOrderReturnLineID =
 SICL.SOPOrderReturnLineID AND SICL.SOPInvoiceCreditID =
 SIC.SOPInvoiceCreditID AND SL.CustomerAccountNumber = " + Chr(39) +
 "CHE001" + Chr(39) + "" %>'
 Debug="true"
 ></MM:DataSet>
 <MM:PageBind runat="server" PostBackBind="true" />
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
 www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>Untitled Document</title>
 <link href="net2vbstlye.css" rel="stylesheet" type="text/css" />
 </head>
 <body>
 <form runat="server">
 <asp:DataGrid id="DataGrid1"
 runat="server"
 AllowSorting="False"
 AutoGenerateColumns="false"
 CellPadding="3"
 CellSpacing="0"
 ShowFooter="false"
 ShowHeader="true"
 DataSource="<%# CosNums.DefaultView %>"
 PagerStyle-Mode="NextPrev"
 >
 <HeaderStyle HorizontalAlign="center" BackColor="#E8EBFD"
 ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif"
 Font-Bold="true" Font-Size="smaller" />
 <ItemStyle BackColor="#F2F2F2" Font-Name="Verdana, Arial,
 Helvetica, sans-serif" Font-Size="smaller" />
 <AlternatingItemStyle BackColor="#E5E5E5" Font-Name="Verdana,
 Arial, Helvetica, sans-serif" Font-Size="smaller" />
 <FooterStyle HorizontalAlign="center" BackColor="#E8EBFD"
 ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif"
 Font-Bold="true" Font-Size="smaller" />
 <PagerStyle BackColor="white" Font-Name="Verdana, Arial,
 Helvetica, sans-serif" Font-Size="smaller" />
 <Columns>
 <asp:BoundColumn DataField="CustomerAccountName"
 HeaderText="CustomerAccountName"
 ReadOnly="true"
 Visible="True"/>
 <asp:BoundColumn DataField="CustomerAccountNumber"
 HeaderText="CustomerAccountNumber"
 ReadOnly="true"
 Visible="True"/>
 <asp:BoundColumn DataField="documentno"
 HeaderText="documentno"
 ReadOnly="true"
 Visible="True"/>
 <asp:BoundColumn DataField="documentdate"
 HeaderText="documentdate"
 ReadOnly="true"
 Visible="True"/>
 <asp:BoundColumn DataField="AnalysisCode4"
 HeaderText="AnalysisCode4"
 ReadOnly="true"
 Visible="True"/>
 </Columns>
 </asp:DataGrid>
 </form>
 </p>
 </body>
 </html>
 
 
 now, my question is, how can i create a simple form with one input box
 so that i can change the current hardcoded filter from:
 
 SL.CustomerAccountNumber = 'CHE001'
 
 to whatever is entered into the input box.
 
 thanks in advance, any help or tips would be much appreciated!!
 I've had a search in here and online but can't find anything.. i might
 be searching for the wrong solution though!
 
 kev :)
 [Back to original message] |