473,397 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

gridview checkbox not udpating

19
I have a gridview with an update capabilities - a textbox column (roomName), a dropdownlist(orgID), a dropdownlist(roomTypeID),a checkbox column (dialOut), a checkbox column (dialIn). When I try to add another checkbox column, the sql database isn't updated properly with a 0/1 or false/true but with null. I've tried everything I can think of. Can anyone help?

Data command stuff:
Expand|Select|Wrap|Line Numbers
  1.                 UpdateCommand="update telehealth.dbo.xTblRoom set roomname=@roomName,orgID=@orgID,
  2.                     roomTypeID=@roomTypeID,dialOut=@dialout,dialIn=@dialin,webinarCapable=@web WHERE roomID = @roomID" 
  3.                 >
  4.                 <UpdateParameters>
  5.                     <asp:Parameter Name="roomName" Type="String" />
  6.                     <asp:Parameter Name="orgID" Type="Int32" />
  7.                     <asp:Parameter Name="roomTypeID" Type="Int32" />
  8.                     <asp:Parameter Name="dialout" Type="Byte" />
  9.                     <asp:Parameter Name="dialin" Type="Byte" />
  10.                     <asp:Parameter Name="web" Type="Byte"  />
  11.  
  12.                 </UpdateParameters>
Gridview stuff:
Expand|Select|Wrap|Line Numbers
  1. <asp:BoundField DataField="roomID" />                       
  2.   <asp:TemplateField HeaderText="RoomName">
  3.     <EditItemTemplate>
  4.       <asp:TextBox ID="txtRoom" Columns="10" runat="server" SkinID="txtSm" Text='<%# Bind("roomname") %>' />
  5.     </EditItemTemplate>
  6.     <ItemTemplate>
  7.       <asp:Label ID="lblRoom" runat="server" Text='<%# Bind("roomName") %>' />
  8.     </ItemTemplate>
  9.     <FooterTemplate>
  10.       <asp:Button ID="btnAdd"  runat="server" skinID="btnGo" Text="Add" CommandName="Insert" />
  11.       <asp:TextBox ID="txtRoomAdd" Columns="10" runat="server" SkinID="txtSm" />
  12.     </FooterTemplate>
  13.   </asp:TemplateField>
  14.   <asp:TemplateField HeaderText="Org">
  15.     <EditItemTemplate>
  16.       <asp:DropDownList ID="orgDDL" runat="server" SkinID="ddl" DataSourceID="orgDS"
  17. DataTextField="org" DataValueField="orgID" SelectedValue='<%# Bind("orgID") %>'>
  18.       </asp:DropDownList>
  19.       <asp:SqlDataSource ID="orgDS" runat="server" ConnectionString="<%$ ConnectionStrings:Str  %>"
  20. SelectCommand="select statement"></asp:SqlDataSource>
  21.    </EditItemTemplate>
  22.   <ItemTemplate>
  23.     <asp:Label ID="lblOrg" runat="server" Text='<%# Bind("org") %>' />
  24.   </ItemTemplate>
  25.   <FooterTemplate>
  26.     <asp:DropDownList ID="orgDDLAdd" runat="server" SkinID="ddl" DataSourceID="orgAddDS2"
  27. DataTextField="org" DataValueField="orgID">
  28.     </asp:DropDownList>
  29.     <asp:SqlDataSource ID="orgAddDS2" runat="server" ConnectionString="<%$ ConnectionStrings:Str  %>"
  30. SelectCommand="select statement">
  31.     </asp:SqlDataSource>
  32.   </FooterTemplate>
  33. </asp:TemplateField>
  34. <asp:TemplateField HeaderText="Type">
  35.   <EditItemTemplate>
  36.     <asp:DropDownList ID="typeDDL" runat="server" SkinID="ddl" DataSourceID="typeDS"
  37. DataTextField="roomType" DataValueField="roomTypeID" SelectedValue='<%# Bind("roomTypeID") %>'>
  38.     </asp:DropDownList>
  39.     <asp:SqlDataSource ID="typeDS" runat="server" ConnectionString="<%$ ConnectionStrings:Str  %>"
  40. SelectCommand="select statement">
  41.     </asp:SqlDataSource>
  42.   </EditItemTemplate>
  43.   <ItemTemplate>
  44.     <asp:Label ID="lblroomType" runat="server" Text='<%# Bind("roomType") %>' />
  45.   </ItemTemplate>
  46.   <FooterTemplate>
  47.     <asp:DropDownList ID="typeDDLAdd" runat="server" SkinID="ddl" DataSourceID="addDS3"
  48. DataTextField="roomType" DataValueField="roomTypeID">
  49.     </asp:DropDownList>
  50.     <asp:SqlDataSource ID="addDS3" runat="server" ConnectionString="<%$ ConnectionStrings:Str  %>"
  51. SelectCommand="select statement">
  52.     </asp:SqlDataSource>
  53.   </FooterTemplate>
  54. </asp:TemplateField>                                    
  55. <asp:TemplateField HeaderText="DialOut">
  56.   <EditItemTemplate><asp:CheckBox ID="chkOutEdit" runat="server" checked='<%# Bind("dialOut") %>' /></EditItemTemplate>
  57.   <ItemTemplate>
  58.     <asp:CheckBox ID="chkOut" runat="server" checked='<%# Bind("dialOut") %>' Enabled="false" />
  59.   </ItemTemplate>
  60.   <FooterTemplate><asp:CheckBox ID="chkOutAdd" runat="server" /></FooterTemplate>
  61. </asp:TemplateField>
  62. <asp:TemplateField HeaderText="DialIn">
  63.   <EditItemTemplate>
  64.     <asp:CheckBox ID="chkInEdit" runat="server" checked='<%# Bind("dialIn") %>' />
  65.   </EditItemTemplate>
  66.   <ItemTemplate>
  67.     <asp:CheckBox ID="chkIn" runat="server" checked='<%# Bind("dialIn") %>' Enabled="false" />
  68.   </ItemTemplate>
  69.   <FooterTemplate><asp:CheckBox ID="chkInAdd" runat="server" /></FooterTemplate>
  70. </asp:TemplateField>
  71. <asp:TemplateField HeaderText="Webinar">
  72.   <EditItemTemplate>
  73.     <asp:CheckBox ID="chkWebEdit" runat="server" checked='<%# Bind("webinarCapable") %>' />
  74.   </EditItemTemplate>
  75.   <ItemTemplate>
  76.     <asp:CheckBox ID="chkWeb" runat="server" checked='<%# Bind("webinarCapable") %>' Enabled="false" />
  77.   </ItemTemplate>
  78.   <FooterTemplate><asp:CheckBox ID="chkWebAdd" runat="server" /></FooterTemplate>
  79. </asp:TemplateField>
sql stuff:
Expand|Select|Wrap|Line Numbers
  1. TABLE [dbo].[myTable](
  2.     [roomID] [int] IDENTITY(1,1) NOT NULL,
  3.     [roomName] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
  4.     [orgID] [int] NULL,
  5.     [roomTypeID] [int] NULL,
  6.     [dialOut] [bit] NULL CONSTRAINT [DF_xTblRoom_dialOut]  DEFAULT ((0)),
  7.     [dialIn] [bit] NULL CONSTRAINT [DF_xTblRoom_dialIn]  DEFAULT ((0)),
  8.     [webinarCapable] [bit] NULL CONSTRAINT [DF_xTblRoom_webinarCapable]  DEFAULT ((0))
Oct 20 '09 #1
1 3773
janetb
19
Not sure what I did wrong, still, but I deleted the aspx page and started over from scratch. Everything works fine now..... Scratchin' my head hard!
Oct 20 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: MasterChief | last post by:
I have a customer that likes the gridview but instead of using the standard Delete command for each row he wants to be able to put a checkbox next to the row so he can chose multiple records and...
1
by: postings | last post by:
Hi I have problems with autopostback and the gridview control. Please continue reading. The code below turns a row red when a tickbox is ticked in edititemtemplate. Note autopostback on the...
0
by: Mike P | last post by:
I am trying to edit a gridview while using paging, but whenever I try to edit a row on a page other than page 1, I get an error. Here is my gridview and my code : <asp:GridView ID="GridView1"...
1
by: mercercreek | last post by:
This one should be easy. Hope someone has a clue. Simple Scenario: Gridview with mulitple rows, each row with a checkbox. The user checks boxes of her choice. Clicks a button on the form (not in...
1
by: Neven Klofutar | last post by:
Hi, I have a questin regarding GridView, Template column and Checkbox in it. I'm working on a project that has several "client" applications entering data into DB, and one "admin" application...
12
by: dixonjm | last post by:
Hi, I am new to gridviews, so any help would be most appreciated. Here is my problem:- I have a form with a GridView and a button. My gridview is bound to a collection (12000 items) (PageSize...
0
by: sharonrao123 | last post by:
hello all, I have a parent gridview company and in this one a nested gridview people, Is it possible to allow the user to select one row or multiple rows from the people gridview using a check box...
1
Frinavale
by: Frinavale | last post by:
I'm working on an ASP.NET application using VB.NET for server side code. I have a GridView listing a bunch of stuff. Above the GridView I have a checkbox named "ChkBx_SelectAll". If this...
0
by: dotnetrookie | last post by:
Hi This is my 1st post.I have two checkbox columns in gridview binded through item template. The checkboxes are Category and Subcategory. I have actually removed the duplicate values in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.