I am using Dynamic SQl in my stored Procedure. In front end I am using C#.net gridview to display the data.
I have three fields in my Table,
1) Active- Bit 2) DateMadeInactive-smallDate 3)Comments-Varchar(Max)
Depending on the condition of the active Value I have to display those three or two fields in the gridview.
If Active= true, Then I have to display active and Comments.
If Active =false, Then I have to DateMadeInactive and Comments Fields.
For Rendering the Active field I am using the following
<asp:TemplateField HeaderText="Comments" SortExpression="Comments" >
<ItemTemplate>
<%#Eval("Comments")%>
</ItemTemplate>
</asp:TemplateField>
In my stored Procedure I am checking Like this for null, if its null then I am displaying as false
set @SQLQuery = @SQLQuery+ ',isnull(Register.Active,''0'')as Active,
Could anybody tell me where do I check for the Active value or Is there any method in SQL which Checks for the True/False condition of the field.
I am not expecting complete answer, just a hint only...
Thank you.
Hari