Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

.Net 2.0 - Edit Bit datatype in a gridview

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul - 27 Jun 2007 22:00 GMT
I have a table with a field with a bit datatype.

I use a gridview to edit that a row in that table. I use SQLDataSource and
enable editbutton property to get a link to edit the row.

That all works fine but after I click the edit link, the bit field turns
into a text field (displaying true/false string), rather than a checkbox (or
radiobutton).

Is this by design? I just want a checkdown to edit that true-false bit field?
Alexey Smirnov - 28 Jun 2007 08:57 GMT
> I have a table with a field with a bit datatype.
>
[quoted text clipped - 6 lines]
>
> Is this by design? I just want a checkdown to edit that true-false bit field?

for me it works well

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="server=..."
SelectCommand="SELECT Id, ... FROM ..."
updatecommand="UPDATE ... SET ... WHERE Id = @Id"

</asp:SqlDataSource>

<asp:GridView ID="GridView1" runat="server"
DataKeyNames="Id"
autogenerateeditbutton="true"
DataSourceID="SqlDataSource1"></asp:GridView>

I have a bit field and I see a checkbox in the edit mode.

I'm not sure if it makes sense to cast, try

SELECT ... CONVERT(bit,[fieldname]) as [fieldname]

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.