这是我想要实现的伪代码
<asp:TemplateField HeaderText="CGST Per Unit">
<ItemTemplate> <asp:TextBox ID="txtCGSTAmount" runat="server" Width="100px" TextMode="Number" Text="0"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SGST Per Unit">
<ItemTemplate><asp:TextBox ID="txtSGSTAmount" runat="server" Width="100px" TextMode="Number" Text="0"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IGST Per Unit" Visible="false">
<ItemTemplate><asp:TextBox ID="txtIGSTAmount" runat="server" TextMode="Number" Width="100px" Text="0"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
protected void rdbtnCGSTSGST_CheckedChanged(object sender, EventArgs e)
{
if (grvViewData.Columns.Count > 0)
{
grvViewData.Columns[5].Visible= true;
grvViewData.Columns[6].Visible= true;
grvViewData.Columns[7].Visible= false;
}
}
protected void rdbtnIGST_CheckedChanged(object sender, EventArgs e)
{
if (grvViewData.Columns.Count > 0)
{
grvViewData.Columns[7].Visible = true;
grvViewData.Columns[5].Visible = false;
grvViewData.Columns[6].Visible = false;
}
}
我必须在视图中使用sp,函数等
感谢您提供的任何帮助
答案 0 :(得分:0)
这是你想要的吗?
Select a.*, b.* from TableA a join TableB b
on b.criteria = case when a.Criteria = 1
then 1 else null end
答案 1 :(得分:0)
这可能是你想要的:
select a.*, b.*
from a left join
b
on b.criteria = a.criteria and b.criteria = 1;
即使left join
条件不成立,a
也会将所有行保留在on
中。 b
的额外列将为NULL
,除非标准均为“1”。