Hi,
I have a column of type bit, I want to display checkboxes on bases of values 1 and 0. So that in edit mode if i unchecked the box then the database should contain the value 0.
Can anyone help on this please.
<%@ Page Language="
VB" AutoEventWireup="false" CodeFile="Default.aspx.
vb" Inherits="__admin_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False"
DataKeyNames="Contestantid"
DataSourceID="SqlDataSource1"
OnRowUpdated="GridView1_RowUpdated"
ShowFooter="true"
>
<Columns>
<asp:CommandField ShowDeleteButton="True"
ShowEditButton="True" />
<asp:TemplateField HeaderText="ID" SortExpression="ID">
<ItemTemplate>
<asp:Label ID="lblID" runat="server"
Text='<%#Eval("ContestantId") %>'>
</asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:Button ID="btnInsert" runat="server"
Text="Insert" CommandName="Add" />
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="FirstName"
SortExpression="FirstName">
<ItemTemplate>
<asp:Label ID="lblFirstName" runat="server"
Text='<%#Eval("iContestantName") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtFirstName" runat="server"
Text='<%#Bind("iContestantName") %>'>
</asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtFname" runat="server">
</asp:TextBox>
</FooterTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:sdasdadasConnectionString%>"
SelectCommand="SELECT [ContestantID], [iContestantName] ,[iContestantCompany] ,[iContestantStore] ,[iNominationText] ,[iNominatorPhone] ,[iNominatorEmail], [Activate] FROM [SMOTY_tblContestantabc]"
UpdateCommand="UPDATE [SMOTY_tblContestant] SET [iContestantName] =@iContestantName where [ContestantID] = @ContestantId">
<UpdateParameters>
<asp:Parameter Name="iContestantName" Type="string" />
<asp:Parameter Name="ContestantID" Type="int32" />
</UpdateParameters>
</asp:SqlDataSource>
<asp:Label ID="lblMessage" runat="server"
Font-Bold="True"></asp:Label><br />
<br />
<br />
</div>
</form>
</body>
</html>