hi,
I am getting an error
:\Users\tmarie\Documents\MSDN\test\secure_members\ OrderSearch.aspx(26) : error BC30451: Name 'CustomerID' is not declared.
SqlDataSource1.SelectCommand = "SELECT [ORDERID], [STATUS], [CUSTOMERID], [CUSTOMER_PO] FROM [test.csv] WHERE CUSTOMERID = " & CustomerID()
~~~~~~~~~~
C:\Users\tmarie\Documents\MSDN\test\secure_members \OrderSearch.aspx(27) : error BC30455: Argument not specified for parameter 'arguments' of 'Public Function Select(arguments As System.Web.UI.DataSourceSelectArguments) As System.Collections.IEnumerable'.
SqlDataSource1.Select()
~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\tmarie\Documents\MSDN\test\secure_members \OrderSearch.aspx(35) : error BC30455: Argument not specified for parameter 'arguments' of 'Public Function Select(arguments As System.Web.UI.DataSourceSelectArguments) As System.Collections.IEnumerable'.
SqlDataSource1.Select()
~~~~~~~~~~~~~~~~~~~~~~~
I thought that i declared 'CustomerID at the top.
and where in the Page_Load event do i put the if post back?
code i have right now.
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" %>
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
If Not Page.IsPostBack Then
Session("CustomerID") = Nothing
If User.Identity.IsAuthenticated Then
If User.IsInRole("admin") Then
If Request("CustomerID") IsNot Nothing Then
Session("CustomerID") = Request("CustomerID")
End If
Else
Session("CustomerID") = User.Identity.Name
End If
End If
'SqlDataSource1.SelectCommand = "SELECT [ORDERID], [STATUS], [CUSTOMERID], [CUSTOMER_PO] FROM [test.csv] WHERE CUSTOMERID = " & CustomerID()
'SqlDataSource1.Select()
'GridView1.DataBind()
End If
If Not IsPostBack Then
SqlDataSource1.SelectCommand = "SELECT [ORDERID], [STATUS], [CUSTOMERID], [CUSTOMER_PO] FROM [test.csv] WHERE CUSTOMERID = " & CustomerID()
SqlDataSource1.Select()
GridView1.DataBind()
End If
End Sub
Protected Sub Search_Click(ByVal sender As Object, ByVal e As System.EventArgs)SqlDataSource1.SelectCommand = "SELECT * FROM [test.csv] WHERE " & DropDownList1.SelectedItem.Text & " = " & txtSearch.Text
SqlDataSource1.Select()
GridView1.DataBind()
End Sub
</script>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" SkinID="KylieSkin"
EmptyDataText="There are no data records to display." AllowPaging="True" AllowSorting="True"
PageSize="20">
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
SelectCommand="SELECT [ORDERID], [STATUS], [CUSTOMERID], [CUSTOMER_PO] FROM [test.csv] WHERE ([CUSTOMERID] = ?)" />
<selectparameters>
<asp:SessionParameter Name="CUSTOMERID" SessionField="CUSTOMERID" Type="String" />
</selectparameters>
</asp:SqlDataSource>
<asp

ropDownList ID="DropDownList1" runat="server">
<asp:ListItem Value="Customer_PO">Customer P.O.</asp:ListItem>
</asp

ropDownList>
<asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="search" /><br />
</asp:Content>