当前位置: 代码迷 >> .NET新技术 >> 查询时候出现列名 'TypeID' 不明确有关问题
  详细解决方案

查询时候出现列名 'TypeID' 不明确有关问题

热度:492   发布时间:2016-04-25 01:25:48.0
查询时候出现列名 'TypeID' 不明确问题
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="KC.index" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server" style="border:solid 2px #808080; width:700px;height:550px" >
        <div>
            <img src="1/armstrong-logo.gif" />
        </div>
       <div ">
        <asp:Label ID="Label4" runat="server" Text="全国库存"></asp:Label>
        <asp:Button ID="Button1" runat="server" Text="查询" />
        <br />
       </div>
     <div style="border-color:#fff;">
        <asp:Label ID="Label1" runat="server" Text="查询条件"></asp:Label>
        <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1" DataTextField="Category" DataValueField="GLID" AutoPostBack="True">
        </asp:DropDownList>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AMSZConnectionString %>" SelectCommand="SELECT [CID], [Category], [GLID] FROM [Category]"></asp:SqlDataSource>
        <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource2" DataTextField="Type" DataValueField="GLID2" AutoPostBack="True">
            <asp:ListItem>GLID</asp:ListItem>
        </asp:DropDownList>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:AMSZConnectionString %>" SelectCommand="SELECT [TypeID], [Type], [GLID], [GLID2] FROM [Type] WHERE ([GLID] = @GLID)">
            <SelectParameters>
                <asp:ControlParameter ControlID="DropDownList1" Name="GLID" PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
         </asp:SqlDataSource>
        <asp:DropDownList ID="DropDownList3" runat="server" DataSourceID="SqlDataSource3" DataTextField="Color" DataValueField="ColorID" AutoPostBack="True">
            <asp:ListItem>GLID2</asp:ListItem>
        </asp:DropDownList>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:AMSZConnectionString %>" SelectCommand="SELECT [ColorID], [Color], [GLID2], [CWID] FROM [Color] WHERE ([GLID2] = @GLID2)">
            <SelectParameters>
                <asp:ControlParameter ControlID="DropDownList2" Name="GLID2" PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
         </asp:SqlDataSource>
        <asp:DropDownList ID="DropDownList4" runat="server" DataSourceID="SqlDataSource4" DataTextField="WearLayer" DataValueField="WearLayerID" AutoPostBack="True">
            <asp:ListItem>CWID</asp:ListItem>
        </asp:DropDownList>
        <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:AMSZConnectionString %>" SelectCommand="SELECT [WearLayerID], [WearLayer], [CWID], [WTID] FROM [WearLay] WHERE ([CWID] = @CWID)">
            <SelectParameters>
                <asp:ControlParameter ControlID="DropDownList3" Name="CWID" PropertyName="SelectedValue" Type="Int32" />