Y
yixiang
Hi All,
I am a newbie to .NET programming and have been figuring out this
(master/detail) control.
However, it is not working...can someone please help me out???
<asp:GridView ID="GridView1" runat="server" DataKeyNames="ServiceID,
VersionNum" CellPadding="4" DataSourceID="SqlDataSource1"
ForeColor="#333333" GridLines="None"
Height="81px" Width="16px">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True"
ForeColor="White" />
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="VersionNum"
HeaderText="VersionNum" ReadOnly="True" SortExpression="VersionNum" />
<asp:BoundField DataField="ServiceID"
HeaderText="ServiceID" ReadOnly="True" SortExpression="ServiceID" />
<asp:BoundField DataField="VersionDesc"
HeaderText="VersionDesc" SortExpression="VersionDesc" />
</Columns>
</asp:GridView>
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>"
ProviderName="<%$ ConnectionStrings:ConnectionString2.
ProviderName %>" SelectCommand="SELECT [ServiceID], [VersionNum],
[VersionDesc] FROM [w_ServiceVersion]">
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td style="width: 737px; height: 21px">
<asp:FormView ID="FormView1" runat="server"
DataKeyNames="ServiceID,VersionNum" DataSourceID="SqlDataSource2"
Width="555px">
<EditItemTemplate>
...........
</EditItemTemplate>
<InsertItemTemplate>
.............
</InsertItemTemplate>
<ItemTemplate>
............
</ItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
ProviderName="<%$ ConnectionStrings:ConnectionString.
ProviderName %>" SelectCommand="SELECT ServiceID, VersionNum, VersionDesc
FROM dbo.w_ServiceVersion WHERE (ServiceID = ServiceID AND VersionNum =
VersionNum)">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1"
Name="ServiceID" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="GridView1"
Name="VersionNum" PropertyName="SelectedValue" />
</SelectParameters>
</asp:SqlDataSource>
url:http://ureader.com/gp/1417-1.aspx
I am a newbie to .NET programming and have been figuring out this
(master/detail) control.
However, it is not working...can someone please help me out???
<asp:GridView ID="GridView1" runat="server" DataKeyNames="ServiceID,
VersionNum" CellPadding="4" DataSourceID="SqlDataSource1"
ForeColor="#333333" GridLines="None"
Height="81px" Width="16px">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True"
ForeColor="White" />
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="VersionNum"
HeaderText="VersionNum" ReadOnly="True" SortExpression="VersionNum" />
<asp:BoundField DataField="ServiceID"
HeaderText="ServiceID" ReadOnly="True" SortExpression="ServiceID" />
<asp:BoundField DataField="VersionDesc"
HeaderText="VersionDesc" SortExpression="VersionDesc" />
</Columns>
</asp:GridView>
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>"
ProviderName="<%$ ConnectionStrings:ConnectionString2.
ProviderName %>" SelectCommand="SELECT [ServiceID], [VersionNum],
[VersionDesc] FROM [w_ServiceVersion]">
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td style="width: 737px; height: 21px">
<asp:FormView ID="FormView1" runat="server"
DataKeyNames="ServiceID,VersionNum" DataSourceID="SqlDataSource2"
Width="555px">
<EditItemTemplate>
...........
</EditItemTemplate>
<InsertItemTemplate>
.............
</InsertItemTemplate>
<ItemTemplate>
............
</ItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
ProviderName="<%$ ConnectionStrings:ConnectionString.
ProviderName %>" SelectCommand="SELECT ServiceID, VersionNum, VersionDesc
FROM dbo.w_ServiceVersion WHERE (ServiceID = ServiceID AND VersionNum =
VersionNum)">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1"
Name="ServiceID" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="GridView1"
Name="VersionNum" PropertyName="SelectedValue" />
</SelectParameters>
</asp:SqlDataSource>
url:http://ureader.com/gp/1417-1.aspx