2012-11-20 93 views
0

从之前关于paren-child下拉列表的问题修复之后,我想在选择子dropdownlist(databasename)后制作detailsview显示结果。我试图在detailview中的sqldatasource中添加控件,它似乎不起作用,它显示空白。我在SQLDataSource的SelectCommand中添加了@Database。 这里是亲子下拉​​列表代码,带有DetailsView的ASP.NET Parent-Child DropDownList控件

<asp:Label ID="Label9" runat="server" Text="Select Server:"></asp:Label> 
    <br /> 
    <asp:DropDownList ID="DropDownServerName" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource2" DataTextField="ServerName" DataValueField="ServerName"> 
    </asp:DropDownList> 
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:Database_Shared_NotebookConnectionString %>" SelectCommand="SELECT [ServerName] FROM [tblServer]"></asp:SqlDataSource> 
    <br /> 
    <br /> 
    <br /> 
    <asp:Label ID="Label10" runat="server" Text="Select Database:"></asp:Label> 
    <br /> 
    <asp:DropDownList ID="DropDownDatabase" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource3" DataTextField="DatabaseName" DataValueField="DatabaseName"> 
    </asp:DropDownList> 
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:Database_Shared_NotebookConnectionString %>" SelectCommand="SELECT [DatabaseName] FROM [tblDatabase] WHERE [ServerName] = @ServerName"> 
     <SelectParameters> 
      <asp:ControlParameter ControlID="DropDownServerName" Name="ServerName" PropertyName="SelectedValue" /> 
     </SelectParameters> 
    </asp:SqlDataSource> 

然后DetailsView控件代码,

<asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False" DataKeyNames="DatabaseName,ServerName,Instance" DataSourceID="SqlDataSource1" Height="50px" Width="125px" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3"> 
     <EditRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" /> 
     <Fields> 
      <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" /> 
      <asp:TemplateField HeaderText="ServerName" SortExpression="ServerName"> 
       <EditItemTemplate> 
        <asp:Label ID="Label1" runat="server" Text='<%# Eval("ServerName") %>'></asp:Label> 
       </EditItemTemplate> 
       <InsertItemTemplate> 
        <asp:DropDownList ID="DropDownList15" runat="server" DataSourceID="servername" DataTextField="ServerName" DataValueField="ServerName" SelectedValue='<%# Bind("ServerName") %>'> 
        </asp:DropDownList> 
        <asp:SqlDataSource ID="servername" runat="server" ConnectionString="<%$ ConnectionStrings:Database_Shared_NotebookConnectionString %>" SelectCommand="SELECT [ServerName] FROM [tblServer]"></asp:SqlDataSource> 
       </InsertItemTemplate> 
       <ItemTemplate> 
        <asp:Label ID="Label8" runat="server" Text='<%# Bind("ServerName") %>'></asp:Label> 
       </ItemTemplate> 
      </asp:TemplateField> 
      <asp:BoundField DataField="Instance" HeaderText="Instance" ReadOnly="True" SortExpression="Instance" /> 
      <asp:BoundField DataField="DatabaseName" HeaderText="DatabaseName" ReadOnly="True" SortExpression="DatabaseName" /> 
      <asp:BoundField DataField="InstanceOccurence" HeaderText="InstanceOccurence" SortExpression="InstanceOccurence" /> 
      <asp:BoundField DataField="OccurenceNormalState" HeaderText="OccurenceNormalState" SortExpression="OccurenceNormalState" /> 
      <asp:BoundField DataField="SupportedFuntionalArea" HeaderText="SupportedFuntionalArea" SortExpression="SupportedFuntionalArea" /> 
      <asp:TemplateField HeaderText="Primary_DBA" SortExpression="Primary_DBA"> 
       <EditItemTemplate> 
        <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="userid" DataTextField="UserID" DataValueField="UserID" SelectedValue='<%# Bind("Primary_DBA") %>'> 
        </asp:DropDownList> 
        <asp:SqlDataSource ID="userid" runat="server" ConnectionString="<%$ ConnectionStrings:Database_Shared_NotebookConnectionString %>" SelectCommand="SELECT [UserID] FROM [tblDBA]"></asp:SqlDataSource> 
       </EditItemTemplate> 
       <InsertItemTemplate> 
        <asp:DropDownList ID="DropDownList8" runat="server" DataSourceID="userid" DataTextField="UserID" DataValueField="UserID" SelectedValue='<%# Bind("Primary_DBA") %>'> 
        </asp:DropDownList> 
        <asp:SqlDataSource ID="userid" runat="server" ConnectionString="<%$ ConnectionStrings:Database_Shared_NotebookConnectionString %>" SelectCommand="SELECT [UserID] FROM [tblDBA]"></asp:SqlDataSource> 
       </InsertItemTemplate> 
       <ItemTemplate> 
        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Primary_DBA") %>'></asp:Label> 
       </ItemTemplate> 
      </asp:TemplateField> 
      <asp:BoundField DataField="Quarter_Close_Vital" HeaderText="Quarter_Close_Vital" SortExpression="Quarter_Close_Vital" /> 
      <asp:BoundField DataField="Business_Importance" HeaderText="Business_Importance" SortExpression="Business_Importance" /> 
      <asp:BoundField DataField="Application_Number" HeaderText="Application_Number" SortExpression="Application_Number" /> 
      <asp:BoundField DataField="Portfolio_Lookup" HeaderText="Portfolio_Lookup" SortExpression="Portfolio_Lookup" /> 
      <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" /> 
      <asp:TemplateField HeaderText="WorkProcess" SortExpression="WorkProcess"> 
       <EditItemTemplate> 
        <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="workprocess" DataTextField="WorkProcess" DataValueField="WorkProcess" SelectedValue='<%# Bind("WorkProcess") %>'> 
        </asp:DropDownList> 
        <asp:SqlDataSource ID="workprocess" runat="server" ConnectionString="<%$ ConnectionStrings:Database_Shared_NotebookConnectionString %>" SelectCommand="SELECT [WorkProcess] FROM [tblWorkProcess]"></asp:SqlDataSource> 
       </EditItemTemplate> 
       <InsertItemTemplate> 
        <asp:DropDownList ID="DropDownList9" runat="server" DataSourceID="workprocess" DataTextField="WorkProcess" DataValueField="WorkProcess" SelectedValue='<%# Bind("WorkProcess") %>'> 
        </asp:DropDownList> 
        <asp:SqlDataSource ID="workprocess" runat="server" ConnectionString="<%$ ConnectionStrings:Database_Shared_NotebookConnectionString %>" SelectCommand="SELECT [WorkProcess] FROM [tblWorkProcess]"></asp:SqlDataSource> 
       </InsertItemTemplate> 
       <ItemTemplate> 
        <asp:Label ID="Label1" runat="server" Text='<%# Bind("WorkProcess") %>'></asp:Label> 
       </ItemTemplate> 
      </asp:TemplateField> 
      <asp:BoundField DataField="Data_Owner_1" HeaderText="Data_Owner_1" SortExpression="Data_Owner_1" /> 
      <asp:BoundField DataField="Data_Owner_2" HeaderText="Data_Owner_2" SortExpression="Data_Owner_2" /> 
      <asp:TemplateField HeaderText="TMASGroupNumber" SortExpression="TMASGroupNumber"> 
       <EditItemTemplate> 
        <asp:DropDownList ID="DropDownList3" runat="server" DataSourceID="TMAS" DataTextField="TMASGroupNumber" DataValueField="TMASGroupNumber" SelectedValue='<%# Bind("TMASGroupNumber") %>'> 
        </asp:DropDownList> 
        <asp:SqlDataSource ID="TMAS" runat="server" ConnectionString="<%$ ConnectionStrings:Database_Shared_NotebookConnectionString %>" SelectCommand="SELECT [TMASGroupNumber] FROM [tblTM_AS]"></asp:SqlDataSource> 
       </EditItemTemplate> 
       <InsertItemTemplate> 
        <asp:DropDownList ID="DropDownList10" runat="server" DataSourceID="TMAS" DataTextField="TMASGroupNumber" DataValueField="TMASGroupNumber" SelectedValue='<%# Bind("TMASGroupNumber") %>'> 
        </asp:DropDownList> 
        <asp:SqlDataSource ID="TMAS" runat="server" ConnectionString="<%$ ConnectionStrings:Database_Shared_NotebookConnectionString %>" SelectCommand="SELECT [TMASGroupNumber] FROM [tblTM_AS]"></asp:SqlDataSource> 
       </InsertItemTemplate> 
       <ItemTemplate> 
        <asp:Label ID="Label3" runat="server" Text='<%# Bind("TMASGroupNumber") %>'></asp:Label> 
       </ItemTemplate> 
      </asp:TemplateField> 
      <asp:TemplateField HeaderText="TMLASGroupNumber" SortExpression="TMLASGroupNumber"> 
       <EditItemTemplate> 
        <asp:DropDownList ID="DropDownList4" runat="server" DataSourceID="TMLAS" DataTextField="TMLASGroupNumber" DataValueField="TMLASGroupNumber" SelectedValue='<%# Bind("TMLASGroupNumber") %>'> 
        </asp:DropDownList> 
        <asp:SqlDataSource ID="TMLAS" runat="server" ConnectionString="<%$ ConnectionStrings:Database_Shared_NotebookConnectionString %>" SelectCommand="SELECT [TMLASGroupNumber] FROM [tblTM_LAS]"></asp:SqlDataSource> 
       </EditItemTemplate> 
       <InsertItemTemplate> 
        <asp:DropDownList ID="DropDownList11" runat="server" DataSourceID="TMLAS" DataTextField="TMLASGroupNumber" DataValueField="TMLASGroupNumber" SelectedValue='<%# Bind("TMLASGroupNumber") %>'> 
        </asp:DropDownList> 
        <asp:SqlDataSource ID="TMLAS" runat="server" ConnectionString="<%$ ConnectionStrings:Database_Shared_NotebookConnectionString %>" SelectCommand="SELECT [TMLASGroupNumber] FROM [tblTM_LAS]"></asp:SqlDataSource> 
       </InsertItemTemplate> 
       <ItemTemplate> 
        <asp:Label ID="Label4" runat="server" Text='<%# Bind("TMLASGroupNumber") %>'></asp:Label> 
       </ItemTemplate> 
      </asp:TemplateField> 
      <asp:TemplateField HeaderText="IIASGroupNumber" SortExpression="IIASGroupNumber"> 
       <EditItemTemplate> 
        <asp:DropDownList ID="DropDownList5" runat="server" DataSourceID="IIAS" DataTextField="IIASGroupNumber" DataValueField="IIASGroupNumber" SelectedValue='<%# Bind("IIASGroupNumber") %>'> 
        </asp:DropDownList> 
        <asp:SqlDataSource ID="IIAS" runat="server" ConnectionString="<%$ ConnectionStrings:Database_Shared_NotebookConnectionString %>" SelectCommand="SELECT [IIASGroupNumber] FROM [tblII_AS]"></asp:SqlDataSource> 
       </EditItemTemplate> 
       <InsertItemTemplate> 
        <asp:DropDownList ID="DropDownList12" runat="server" DataSourceID="IIAS" DataTextField="IIASGroupNumber" DataValueField="IIASGroupNumber" SelectedValue='<%# Bind("IIASGroupNumber") %>'> 
        </asp:DropDownList> 
        <asp:SqlDataSource ID="IIAS" runat="server" ConnectionString="<%$ ConnectionStrings:Database_Shared_NotebookConnectionString %>" SelectCommand="SELECT [IIASGroupNumber] FROM [tblII_AS]"></asp:SqlDataSource> 
       </InsertItemTemplate> 
       <ItemTemplate> 
        <asp:Label ID="Label5" runat="server" Text='<%# Bind("IIASGroupNumber") %>'></asp:Label> 
       </ItemTemplate> 
      </asp:TemplateField> 
      <asp:BoundField DataField="Backup_Nodes" HeaderText="Backup_Nodes" SortExpression="Backup_Nodes" /> 
      <asp:BoundField DataField="ConnectionString" HeaderText="ConnectionString" SortExpression="ConnectionString" /> 
      <asp:BoundField DataField="Notes" HeaderText="Notes" SortExpression="Notes" /> 
      <asp:BoundField DataField="Role_Based_Security_Doc" HeaderText="Role_Based_Security_Doc" SortExpression="Role_Based_Security_Doc" /> 
      <asp:BoundField DataField="Alias" HeaderText="Alias" SortExpression="Alias" /> 
      <asp:TemplateField HeaderText="Architecture" SortExpression="Architecture"> 
       <EditItemTemplate> 
        <asp:DropDownList ID="DropDownList6" runat="server" SelectedValue='<%# Bind("Architecture") %>'> 
         <asp:ListItem>BSN EAP</asp:ListItem> 
         <asp:ListItem>BSN NEA</asp:ListItem> 
         <asp:ListItem>BSNConnect.com</asp:ListItem> 
         <asp:ListItem>BSNDMZ.COM</asp:ListItem> 
         <asp:ListItem>Dow EAP</asp:ListItem> 
         <asp:ListItem>Dow NEA</asp:ListItem> 
        </asp:DropDownList> 
       </EditItemTemplate> 
       <InsertItemTemplate> 
        <asp:DropDownList ID="DropDownList13" runat="server" SelectedValue='<%# Bind("Architecture") %>'> 
         <asp:ListItem>BSN EAP</asp:ListItem> 
         <asp:ListItem>BSN NEA</asp:ListItem> 
         <asp:ListItem>BSNConnect.com</asp:ListItem> 
         <asp:ListItem>BSNDMZ.COM</asp:ListItem> 
         <asp:ListItem>Dow EAP</asp:ListItem> 
         <asp:ListItem>Dow NEA</asp:ListItem> 
        </asp:DropDownList> 
       </InsertItemTemplate> 
       <ItemTemplate> 
        <asp:Label ID="Label6" runat="server" Text='<%# Bind("Architecture") %>'></asp:Label> 
       </ItemTemplate> 
      </asp:TemplateField> 
      <asp:BoundField DataField="Max_Users" HeaderText="Max_Users" SortExpression="Max_Users" /> 
      <asp:BoundField DataField="Projected_Growth" HeaderText="Projected_Growth" SortExpression="Projected_Growth" /> 
      <asp:BoundField DataField="Storage_Requirements" HeaderText="Storage_Requirements" SortExpression="Storage_Requirements" /> 
      <asp:BoundField DataField="SID" HeaderText="SID" SortExpression="SID" /> 
      <asp:TemplateField HeaderText="Version" SortExpression="Version"> 
       <EditItemTemplate> 
        <asp:DropDownList ID="DropDownList7" runat="server" SelectedValue='<%# Bind("Version") %>'> 
         <asp:ListItem>Oracle 11g</asp:ListItem> 
         <asp:ListItem>Oracle 11g R2</asp:ListItem> 
         <asp:ListItem>SQL Server 2008</asp:ListItem> 
         <asp:ListItem>SQL Server 2008 R2</asp:ListItem> 
         <asp:ListItem>SQL Server 2012</asp:ListItem> 
         <asp:ListItem>SQL Svr 2008 R2 SS%S</asp:ListItem> 
         <asp:ListItem>SQL Svr 2012 SS%S</asp:ListItem> 
        </asp:DropDownList> 
       </EditItemTemplate> 
       <InsertItemTemplate> 
        <asp:DropDownList ID="DropDownList14" runat="server" SelectedValue='<%# Bind("Version") %>'> 
         <asp:ListItem>Oracle 11g</asp:ListItem> 
         <asp:ListItem>Oracle 11g R2</asp:ListItem> 
         <asp:ListItem>SQL Server 2008</asp:ListItem> 
         <asp:ListItem>SQL Server 2008 R2</asp:ListItem> 
         <asp:ListItem>SQL Server 2012</asp:ListItem> 
         <asp:ListItem>SQL Svr 2008 R2 SS%S</asp:ListItem> 
         <asp:ListItem>SQL Svr 2012 SS%S</asp:ListItem> 
        </asp:DropDownList> 
       </InsertItemTemplate> 
       <ItemTemplate> 
        <asp:Label ID="Label7" runat="server" Text='<%# Bind("Version") %>'></asp:Label> 
       </ItemTemplate> 
      </asp:TemplateField> 
     </Fields> 
     <FooterStyle BackColor="White" ForeColor="#000066" /> 
     <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" /> 
     <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" /> 
     <RowStyle ForeColor="#000066" /> 
    </asp:DetailsView> 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:Database_Shared_NotebookConnectionString %>" DeleteCommand="DELETE FROM [tblDatabase] WHERE [DatabaseName] = @original_DatabaseName AND [ServerName] = @original_ServerName AND [Instance] = @original_Instance AND [WorkProcess] = @original_WorkProcess AND [Primary_DBA] = @original_Primary_DBA AND [TMLASGroupNumber] = @original_TMLASGroupNumber AND [TMASGroupNumber] = @original_TMASGroupNumber AND [IIASGroupNumber] = @original_IIASGroupNumber AND (([Architecture] = @original_Architecture) OR ([Architecture] IS NULL AND @original_Architecture IS NULL)) AND (([Version] = @original_Version) OR ([Version] IS NULL AND @original_Version IS NULL)) AND (([Quarter_Close_Vital] = @original_Quarter_Close_Vital) OR ([Quarter_Close_Vital] IS NULL AND @original_Quarter_Close_Vital IS NULL)) AND (([Business_Importance] = @original_Business_Importance) OR ([Business_Importance] IS NULL AND @original_Business_Importance IS NULL)) AND (([Application_Number] = @original_Application_Number) OR ([Application_Number] IS NULL AND @original_Application_Number IS NULL)) AND (([Description] = @original_Description) OR ([Description] IS NULL AND @original_Description IS NULL)) AND (([Role_Based_Security_Doc] = @original_Role_Based_Security_Doc) OR ([Role_Based_Security_Doc] IS NULL AND @original_Role_Based_Security_Doc IS NULL)) AND (([Max_Users] = @original_Max_Users) OR ([Max_Users] IS NULL AND @original_Max_Users IS NULL)) AND (([Storage_Requirements] = @original_Storage_Requirements) OR ([Storage_Requirements] IS NULL AND @original_Storage_Requirements IS NULL)) AND (([Projected_Growth] = @original_Projected_Growth) OR ([Projected_Growth] IS NULL AND @original_Projected_Growth IS NULL)) AND (([Data_Owner_1] = @original_Data_Owner_1) OR ([Data_Owner_1] IS NULL AND @original_Data_Owner_1 IS NULL)) AND (([Data_Owner_2] = @original_Data_Owner_2) OR ([Data_Owner_2] IS NULL AND @original_Data_Owner_2 IS NULL)) AND (([SID] = @original_SID) OR ([SID] IS NULL AND @original_SID IS NULL)) AND (([Alias] = @original_Alias) OR ([Alias] IS NULL AND @original_Alias IS NULL)) AND (([Backup_Nodes] = @original_Backup_Nodes) OR ([Backup_Nodes] IS NULL AND @original_Backup_Nodes IS NULL)) AND (([Portfolio_Lookup] = @original_Portfolio_Lookup) OR ([Portfolio_Lookup] IS NULL AND @original_Portfolio_Lookup IS NULL)) AND (([Notes] = @original_Notes) OR ([Notes] IS NULL AND @original_Notes IS NULL)) AND (([ConnectionString] = @original_ConnectionString) OR ([ConnectionString] IS NULL AND @original_ConnectionString IS NULL)) AND (([InstanceOccurence] = @original_InstanceOccurence) OR ([InstanceOccurence] IS NULL AND @original_InstanceOccurence IS NULL)) AND (([OccurenceNormalState] = @original_OccurenceNormalState) OR ([OccurenceNormalState] IS NULL AND @original_OccurenceNormalState IS NULL)) AND (([SupportedFuntionalArea] = @original_SupportedFuntionalArea) OR ([SupportedFuntionalArea] IS NULL AND @original_SupportedFuntionalArea IS NULL))" InsertCommand="INSERT INTO [tblDatabase] ([DatabaseName], [ServerName], [WorkProcess], [Primary_DBA], [TMLASGroupNumber], [TMASGroupNumber], [IIASGroupNumber], [Architecture], [Version], [Quarter_Close_Vital], [Business_Importance], [Application_Number], [Description], [Role_Based_Security_Doc], [Max_Users], [Storage_Requirements], [Projected_Growth], [Data_Owner_1], [Data_Owner_2], [SID], [Alias], [Instance], [Backup_Nodes], [Portfolio_Lookup], [Notes], [ConnectionString], [InstanceOccurence], [OccurenceNormalState], [SupportedFuntionalArea]) VALUES (@DatabaseName, @ServerName, @WorkProcess, @Primary_DBA, @TMLASGroupNumber, @TMASGroupNumber, @IIASGroupNumber, @Architecture, @Version, @Quarter_Close_Vital, @Business_Importance, @Application_Number, @Description, @Role_Based_Security_Doc, @Max_Users, @Storage_Requirements, @Projected_Growth, @Data_Owner_1, @Data_Owner_2, @SID, @Alias, @Instance, @Backup_Nodes, @Portfolio_Lookup, @Notes, @ConnectionString, @InstanceOccurence, @OccurenceNormalState, @SupportedFuntionalArea)" OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [tblDatabase] WHERE [DatabaseName] = @DatabaseName" UpdateCommand="UPDATE [tblDatabase] SET [WorkProcess] = @WorkProcess, [Primary_DBA] = @Primary_DBA, [TMLASGroupNumber] = @TMLASGroupNumber, [TMASGroupNumber] = @TMASGroupNumber, [IIASGroupNumber] = @IIASGroupNumber, [Architecture] = @Architecture, [Version] = @Version, [Quarter_Close_Vital] = @Quarter_Close_Vital, [Business_Importance] = @Business_Importance, [Application_Number] = @Application_Number, [Description] = @Description, [Role_Based_Security_Doc] = @Role_Based_Security_Doc, [Max_Users] = @Max_Users, [Storage_Requirements] = @Storage_Requirements, [Projected_Growth] = @Projected_Growth, [Data_Owner_1] = @Data_Owner_1, [Data_Owner_2] = @Data_Owner_2, [SID] = @SID, [Alias] = @Alias, [Backup_Nodes] = @Backup_Nodes, [Portfolio_Lookup] = @Portfolio_Lookup, [Notes] = @Notes, [ConnectionString] = @ConnectionString, [InstanceOccurence] = @InstanceOccurence, [OccurenceNormalState] = @OccurenceNormalState, [SupportedFuntionalArea] = @SupportedFuntionalArea WHERE [DatabaseName] = @original_DatabaseName AND [ServerName] = @original_ServerName AND [Instance] = @original_Instance AND [WorkProcess] = @original_WorkProcess AND [Primary_DBA] = @original_Primary_DBA AND [TMLASGroupNumber] = @original_TMLASGroupNumber AND [TMASGroupNumber] = @original_TMASGroupNumber AND [IIASGroupNumber] = @original_IIASGroupNumber AND (([Architecture] = @original_Architecture) OR ([Architecture] IS NULL AND @original_Architecture IS NULL)) AND (([Version] = @original_Version) OR ([Version] IS NULL AND @original_Version IS NULL)) AND (([Quarter_Close_Vital] = @original_Quarter_Close_Vital) OR ([Quarter_Close_Vital] IS NULL AND @original_Quarter_Close_Vital IS NULL)) AND (([Business_Importance] = @original_Business_Importance) OR ([Business_Importance] IS NULL AND @original_Business_Importance IS NULL)) AND (([Application_Number] = @original_Application_Number) OR ([Application_Number] IS NULL AND @original_Application_Number IS NULL)) AND (([Description] = @original_Description) OR ([Description] IS NULL AND @original_Description IS NULL)) AND (([Role_Based_Security_Doc] = @original_Role_Based_Security_Doc) OR ([Role_Based_Security_Doc] IS NULL AND @original_Role_Based_Security_Doc IS NULL)) AND (([Max_Users] = @original_Max_Users) OR ([Max_Users] IS NULL AND @original_Max_Users IS NULL)) AND (([Storage_Requirements] = @original_Storage_Requirements) OR ([Storage_Requirements] IS NULL AND @original_Storage_Requirements IS NULL)) AND (([Projected_Growth] = @original_Projected_Growth) OR ([Projected_Growth] IS NULL AND @original_Projected_Growth IS NULL)) AND (([Data_Owner_1] = @original_Data_Owner_1) OR ([Data_Owner_1] IS NULL AND @original_Data_Owner_1 IS NULL)) AND (([Data_Owner_2] = @original_Data_Owner_2) OR ([Data_Owner_2] IS NULL AND @original_Data_Owner_2 IS NULL)) AND (([SID] = @original_SID) OR ([SID] IS NULL AND @original_SID IS NULL)) AND (([Alias] = @original_Alias) OR ([Alias] IS NULL AND @original_Alias IS NULL)) AND (([Backup_Nodes] = @original_Backup_Nodes) OR ([Backup_Nodes] IS NULL AND @original_Backup_Nodes IS NULL)) AND (([Portfolio_Lookup] = @original_Portfolio_Lookup) OR ([Portfolio_Lookup] IS NULL AND @original_Portfolio_Lookup IS NULL)) AND (([Notes] = @original_Notes) OR ([Notes] IS NULL AND @original_Notes IS NULL)) AND (([ConnectionString] = @original_ConnectionString) OR ([ConnectionString] IS NULL AND @original_ConnectionString IS NULL)) AND (([InstanceOccurence] = @original_InstanceOccurence) OR ([InstanceOccurence] IS NULL AND @original_InstanceOccurence IS NULL)) AND (([OccurenceNormalState] = @original_OccurenceNormalState) OR ([OccurenceNormalState] IS NULL AND @original_OccurenceNormalState IS NULL)) AND (([SupportedFuntionalArea] = @original_SupportedFuntionalArea) OR ([SupportedFuntionalArea] IS NULL AND @original_SupportedFuntionalArea IS NULL))"> 
     <SelectParameters> 
      <asp:ControlParameter ControlID="DropDownDatabase" Name="DatabaseName" PropertyName="SelectedValue"/> 
     </SelectParameters> 
      <UpdateParameters> 
      <asp:Parameter Name="WorkProcess" Type="String" /> 
      <asp:Parameter Name="Primary_DBA" Type="String" /> 
      <asp:Parameter Name="TMLASGroupNumber" Type="Int32" /> 
      <asp:Parameter Name="TMASGroupNumber" Type="Int32" /> 
      <asp:Parameter Name="IIASGroupNumber" Type="Int32" /> 
      <asp:Parameter Name="Architecture" Type="String" /> 
      <asp:Parameter Name="Version" Type="String" /> 
      <asp:Parameter Name="Quarter_Close_Vital" Type="String" /> 
      <asp:Parameter Name="Business_Importance" Type="String" /> 
      <asp:Parameter Name="Application_Number" Type="String" /> 
      <asp:Parameter Name="Description" Type="String" /> 
      <asp:Parameter Name="Role_Based_Security_Doc" Type="String" /> 
      <asp:Parameter Name="Max_Users" Type="String" /> 
      <asp:Parameter Name="Storage_Requirements" Type="String" /> 
      <asp:Parameter Name="Projected_Growth" Type="String" /> 
      <asp:Parameter Name="Data_Owner_1" Type="String" /> 
      <asp:Parameter Name="Data_Owner_2" Type="String" /> 
      <asp:Parameter Name="SID" Type="String" /> 
      <asp:Parameter Name="Alias" Type="String" /> 
      <asp:Parameter Name="Backup_Nodes" Type="String" /> 
      <asp:Parameter Name="Portfolio_Lookup" Type="String" /> 
      <asp:Parameter Name="Notes" Type="String" /> 
      <asp:Parameter Name="ConnectionString" Type="String" /> 
      <asp:Parameter Name="InstanceOccurence" Type="Decimal" /> 
      <asp:Parameter Name="OccurenceNormalState" Type="String" /> 
      <asp:Parameter Name="SupportedFuntionalArea" Type="String" /> 
      <asp:Parameter Name="original_DatabaseName" Type="String" /> 
      <asp:Parameter Name="original_ServerName" Type="String" /> 
      <asp:Parameter Name="original_Instance" Type="String" /> 
      <asp:Parameter Name="original_WorkProcess" Type="String" /> 
      <asp:Parameter Name="original_Primary_DBA" Type="String" /> 
      <asp:Parameter Name="original_TMLASGroupNumber" Type="Int32" /> 
      <asp:Parameter Name="original_TMASGroupNumber" Type="Int32" /> 
      <asp:Parameter Name="original_IIASGroupNumber" Type="Int32" /> 
      <asp:Parameter Name="original_Architecture" Type="String" /> 
      <asp:Parameter Name="original_Version" Type="String" /> 
      <asp:Parameter Name="original_Quarter_Close_Vital" Type="String" /> 
      <asp:Parameter Name="original_Business_Importance" Type="String" /> 
      <asp:Parameter Name="original_Application_Number" Type="String" /> 
      <asp:Parameter Name="original_Description" Type="String" /> 
      <asp:Parameter Name="original_Role_Based_Security_Doc" Type="String" /> 
      <asp:Parameter Name="original_Max_Users" Type="String" /> 
      <asp:Parameter Name="original_Storage_Requirements" Type="String" /> 
      <asp:Parameter Name="original_Projected_Growth" Type="String" /> 
      <asp:Parameter Name="original_Data_Owner_1" Type="String" /> 
      <asp:Parameter Name="original_Data_Owner_2" Type="String" /> 
      <asp:Parameter Name="original_SID" Type="String" /> 
      <asp:Parameter Name="original_Alias" Type="String" /> 
      <asp:Parameter Name="original_Backup_Nodes" Type="String" /> 
      <asp:Parameter Name="original_Portfolio_Lookup" Type="String" /> 
      <asp:Parameter Name="original_Notes" Type="String" /> 
      <asp:Parameter Name="original_ConnectionString" Type="String" /> 
      <asp:Parameter Name="original_InstanceOccurence" Type="Decimal" /> 
      <asp:Parameter Name="original_OccurenceNormalState" Type="String" /> 
      <asp:Parameter Name="original_SupportedFuntionalArea" Type="String" /> 
     </UpdateParameters> 
    </asp:SqlDataSource> 
+0

我没有看到sqldatsource1声明的任何地方。它是什么拉,它是如何填充的? –

+0

SQLDataSource1代码显示在之后。我希望DetailsView在第二个下拉列表中从所选数据库名称的数据库表中填充所有信息。 – StudentIT

+0

我现在看到它。对不起,我错过了。它只是有一个删除命令,select命令在哪里? –

回答

0

它是做什么的,你告诉它做的事。

<SelectParameters> 
     <asp:ControlParameter ControlID="DropDownServerName" PropertyName="SelectedValue" /> 
    </SelectParameters> 

这是告诉第二个列表基于从第一个选择。如果您希望列表彼此分开,您需要有一个数据库名称列表,您可以使用它列出不依赖于服务器名称选择的数据库名称列表。

编辑:

这似乎是你的语法不正确。

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.controlparameter(v=vs.80).aspx

<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:Database_Shared_NotebookConnectionString %>" SelectCommand="SELECT [DatabaseName] FROM [tblDatabase]"> 
     <SelectParameters> 
      <asp:ControlParameter ControlID="DropDownServerName" PropertyName="SelectedValue" /> 
     </SelectParameters> 
    </asp:SqlDataSource> 

应该

<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:Database_Shared_NotebookConnectionString %>" SelectCommand="SELECT [DatabaseName] FROM [tblDatabase] WHERE [Servername] = @ServerName"> 
    <SelectParameters> 
     <asp:ControlParameter name="ServerName" ControlID="DropDownServerName" PropertyName="SelectedValue" /> 
    </SelectParameters> 
</asp:SqlDataSource> 
+0

我的意思是它应该在第二个下拉列表中显示1个数据库,因为我从第一个下拉列表中选择只有1个数据库的服务器名称,不超过1个。所以缺少某些东西。 – StudentIT

+0

我明白了,所以你需要某种限制标准。 –

+0

它的工作!谢谢! – StudentIT

相关问题