I have 2 tables MachineGroups and Machines. MachineGroups has columns:
MachinegroupID
MachineGroupName
MachineGroupDesc
And Machines has column
Not tested, but the direction should be right:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:SumooHAgentDBConnectionString %>"
SelectCommand="SELECT MachineGroups.MachineGroupID, MachineGroups.MachineGroupName, MachineGroups.MachineGroupDesc, MachineGroups.TimeAdded, MachineGroups.CanBeDeleted, COUNT(Machines.MachineName) AS 'No. of PCs' FROM MachineGroups FULL OUTER JOIN Machines ON Machines.MachineGroupID = MachineGroups.MachineGroupID GROUP BY MachineGroups.MachineGroupID, MachineGroups.MachineGroupName, MachineGroups.MachineGroupDesc, MachineGroups.TimeAdded, MachineGroups.CanBeDeleted"
DeleteCommand="DELETE FROM MachineGroups WHERE MachineGroupID = @MachineGroupID">
<DeleteParameters>
<asp:Parameter Name="MachineGroupID" />
</DeleteParameters>
</asp:SqlDataSource>