String was not recognized as a valid Boolean
For Line: ds_dashboard.Update() in my update function
My SQLDataSource:
-------------------------
<asp:SqlDataSource
ID="ds_dashboard"
runat="server"
ConnectionString="<%$ ConnectionStrings
ashboardConn %>"
SelectCommand="aspx_Get_Customer_DashboardGraphs"
SelectCommandType="StoredProcedure"
UpdateCommand="aspx_Update_Customer_DashboardGraphs"
UpdateCommandType="StoredProcedure"
<UpdateParameters>
<asp
arameter Name="CustomerID" Type="Int32" />
<asp
arameter Name="Budget" Type="Int32" />
<asp
arameter Name="CurrentMonthCollections"
Type="Boolean" />
<asp
arameter Name="RevenueByMonth" Type="Boolean"
/>
<asp
arameter Name="PDCsCCsMonthly" Type="Boolean"
/>
<asp
arameter Name="RevenueByClient" Type="Boolean"
/>
</UpdateParameters>
</asp:SqlDataSource>
My GridView:
---------------------
<asp:GridView
ID="gv_dashboard"
runat="server"
AutoGenerateColumns="False"
DataSourceID="ds_dashboard"
CellPadding="4"
ForeColor="#333333"
ShowFooter="True"
GridLines="None"
CssClass="FormatFont">
<Columns>
<asp:TemplateField HeaderText="Cust #"
SortExpression="CustomerID">
<HeaderStyle HorizontalAlign="center"></HeaderStyle>
<ItemTemplate>
<asp:Label runat="server" id="lblCustomerID"
Text='<%# Bind("Customer") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Budget"
SortExpression="Name"
ItemStyle-HorizontalAlign="Center">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemTemplate>
<asp:TextBox width="55px" MaxLength="10"
ID="txtBudget" Text='<%# Bind("Budget") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Current Month Collections"
SortExpression="Name" ItemStyle-HorizontalAlign="Center">
<HeaderStyle HorizontalAlign="center"></HeaderStyle>
<ItemTemplate>
<asp:checkbox runat="server"
Id="chbx_CurrentMonthCollections" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Revenue By Month"
SortExpression="Name" ItemStyle-HorizontalAlign="Center">
<HeaderStyle HorizontalAlign="center"></HeaderStyle>
<ItemTemplate>
<asp:checkbox runat="server"
Id="chbx_RevenueByMonth" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PDCs & CCS Monthly"
SortExpression="Name" ItemStyle-HorizontalAlign="Center">
<HeaderStyle HorizontalAlign="center"></HeaderStyle>
<ItemTemplate>
<asp:checkbox runat="server"
Id="chbx_PDCsCCsMonthly" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Revenue By Client"
SortExpression="Name" ItemStyle-HorizontalAlign="Center">
<HeaderStyle HorizontalAlign="center"></HeaderStyle>
<ItemTemplate>
<asp:checkbox runat="server"
Id="chbx_RevenueByClient" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#5D7B9D" Font-Bold="True"
ForeColor="White" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<EditRowStyle BackColor="#DDDDDD" />
<SelectedRowStyle BackColor="#DDDDDD" Font-Bold="True"
ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White"
HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True"
ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
My Update Command (Stored Procedure):
--------------------------------------------------
ALTER PROCEDURE [dbo].[aspx_Update_Customer_DashboardGraphs]
@CustomerID bigint,
@Budget int,
@CurrentMonthCollections bit,
@RevenueByMonth bit,
@PDCsCCsMonthly bit,
@RevenueByClient bit
AS
BEGIN
UPDATE dbo.Customer_DashboardGraphs
SET Budget = @Budget,
CurrentMonthCollections = @CurrentMonthCollections,
RevenueByMonth = @RevenueByMonth,
PDCsCCsMonthly = @PDCsCCsMonthly,
RevenueByClient = @RevenueByClient
WHERE Customer_DashboardGraphs.Customer = @CustomerID
END
My Table Schema:
-----------------------
CREATE TABLE [dbo].[Customer_DashboardGraphs](
[Customer] [nchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DashboardGraphID] [bit] NULL,
[CurrentMonthCollections] [bit] NULL,
[RevenueByMonth] [bit] NULL,
[PDCsCCsMonthly] [bit] NULL,
[RevenueByClient] [bit] NULL,
[Budget] [int] NULL
) ON [PRIMARY]
Stack Trace:
String was not recognized as a valid Boolean.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about
the error and where it originated in the code.
Exception Details: System.FormatException: String was not recognized as a
valid Boolean.
Source Error:
Line 53:
ds_dashboard.UpdateParameters("Budget").DefaultValue = intBudget
Line 54:
Line 55: ds_dashboard.Update()
Line 56: End If
Line 57: Next
Source File:
Y:\inetpub\wwwroot\apex\webapps\dashboard\dashboard\index.aspx.vb
Line: 55
Stack Trace:
------------------
[FormatException: String was not recognized as a valid Boolean.]
System.Boolean.Parse(String value) +2709172
System.String.System.IConvertible.ToBoolean(IFormatProvider provider)
+12
System.Convert.ChangeType(Object value, TypeCode typeCode,
IFormatProvider provider) +98
System.Web.UI.WebControls.Parameter.GetValue(Object value, String
defaultValue, TypeCode type, Boolean convertEmptyStringToNull, Boolean
ignoreNullableTypeChanges) +257
System.Web.UI.WebControls.Parameter.get_ParameterValue() +91
System.Web.UI.WebControls.ParameterCollection.GetValues(HttpContext
context, Control control) +282
System.Web.UI.WebControls.SqlDataSourceView.InitializeParameters(DbCommand
command, ParameterCollection parameters, IDictionary exclusionList) +344
System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary
keys, IDictionary values, IDictionary oldValues) +449
System.Web.UI.WebControls.SqlDataSourceView.Update(IDictionary keys,
IDictionary values, IDictionary oldValues) +37
System.Web.UI.WebControls.SqlDataSource.Update() +42
dashboard._Default.UpdateCustomer_DashboardGraphs(Object sender,
EventArgs e) in
Y:\inetpub\wwwroot\sss\webapps\dashboard\dashboard\index.aspx.vb:55
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +96
System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument)
+116
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+72
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+3837
--
dba123
:
which line is the error on?
Karl
--
http://www.openmymind.net/
Why am I getting this error for Budget?
Error: An exception of type 'System.FormatException' occurred in
mscorlib.dll but was not handled in user code
Additional information: String was not recognized as a valid Boolean.
Public Sub UpdateCustomer_DashboardGraphs(ByVal sender As Object,
ByVal
e As System.EventArgs)
For Each gvr As GridViewRow In gv_dashboard.Rows