Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Input string was not in a correct format
Message
From
25/04/2006 04:01:46
Ilyas Mirza
Kensington Computersd
London, United Kingdom
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01114905
Message ID:
01116215
Views:
19
Hi Kevin,

Ihave included two error logs below. First one is to do with DropDownList bound field and the second one is to do with a textbox bound to a date field. In both cases field allow null values in the database. I am using MSDE 2000.

(1)
This happens when Ticket_Contact_id is bound to a drop down list and the lists bindig sorce does not contain any records. If the binding sorce conains items that can be selected then program doesn't complain:
=============================================================================
System.FormatException: Input string was not in a correct format. at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.String.System.IConvertible.ToInt32(IFormatProvider provider) at System.Convert.ToInt32(Object value) at System.Data.Common.Int32Storage.Set(Int32 record, Object value) at System.Data.DataColumn.set_Item(Int32 record, Object value)Couldn't store <> in Ticket_Contact_id Column. Expected type is Int32.
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.ArgumentException: System.FormatException: Input string was not in a correct format. at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.String.System.IConvertible.ToInt32(IFormatProvider provider) at System.Convert.ToInt32(Object value) at System.Data.Common.Int32Storage.Set(Int32 record, Object value) at System.Data.DataColumn.set_Item(Int32 record, Object value)Couldn't store <> in Ticket_Contact_id Column. Expected type is Int32.

Source Error:


Line 463:
Line 464:
Line 465: this.Save(this.oTicket, dsTicket,this.oTicket.TableName );
Line 466:
Line 467: string strPageMode = (string)Session["Ticket_Page_Mode"];


Source File: d:\inetpub\wwwroot\kencrmweb\maintaintickets.aspx.cs Line: 465

Stack Trace:


[ArgumentException: System.FormatException: Input string was not in a correct format.
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.String.System.IConvertible.ToInt32(IFormatProvider provider)
at System.Convert.ToInt32(Object value)
at System.Data.Common.Int32Storage.Set(Int32 record, Object value)
at System.Data.DataColumn.set_Item(Int32 record, Object value)Couldn't store <> in Ticket_Contact_id Column. Expected type is Int32.]
System.Data.DataColumn.set_Item(Int32 record, Object value) +98
System.Data.DataRow.set_Item(DataColumn column, Object value) +280
System.Data.DataRow.set_Item(String columnName, Object value) +72
OakLeaf.MM.Main.Web.UI.mmWebBindingStrategyList.BindBackValueData(ImmWebBindingList listControl, DataSet ds, String tablename, String sourceMember)
OakLeaf.MM.Main.Web.UI.mmWebBindingStrategyList.BindData(ImmWebBindingList mmControl, mmBusinessObject bizObj, Boolean bindBack, mmBusinessStateChangeEventArgs e)
OakLeaf.MM.Main.Web.UI.mmWebBindingStrategyList.BindData(ImmWebBindingList mmControl, mmBaseBusinessObject bizObj, Boolean bindBack, mmBusinessStateChangeEventArgs e)
OakLeaf.MM.Main.Web.UI.WebControls.mmDropDownList.StateChangeHandler(mmBaseBusinessObject bizObj, mmBusinessStateChangeEventArgs e)
OakLeaf.MM.Main.Business.mmBusinessStateChangeDelegate.Invoke(mmBaseBusinessObject bizObj, mmBusinessStateChangeEventArgs e) +0
OakLeaf.MM.Main.Business.mmBusinessObject.OnStateChange(mmBusinessState bizState, String tableName, Object primaryKeyValue, Object[] primaryKeyValues)
OakLeaf.MM.Main.Business.mmBusinessObject.CallStateChange(mmBusinessState bizState, String tableName, DataRow dr)
OakLeaf.MM.Main.Business.mmBusinessObject.CallStateChange(mmBusinessState bizState, String tableName)
OakLeaf.MM.Main.Business.mmBusinessObject.PreSaveProcessing(DataSet ds, String tableName)
OakLeaf.MM.Main.Business.mmBusinessObject.SaveDataSet(DataSet ds, String tableName, String databaseKey, IDbDataAdapter dbAdapter)
OakLeaf.MM.Main.Business.mmBusinessObject.SaveDataSet(DataSet ds, String tableName, String databaseKey)
OakLeaf.MM.Main.Business.mmBusinessObject.SaveDataSet(DataSet ds, String tableName)
OakLeaf.MM.Main.Business.mmBusinessObject.SaveDataSet(DataSet ds)
OakLeaf.MM.Main.Web.UI.mmBusinessWebPage.Save(mmBusinessObject bizObj, DataSet ds, String tableName)
Kensington.KenCRMWeb.testticket.cmdSaveTicket2_Click(Object sender, EventArgs e) in d:\inetpub\wwwroot\kencrmweb\maintaintickets.aspx.cs:465
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292

============================================================================



(2)
Below is the error generated if a date field bound to a text box is left un-touched or blank or supplied with incorrect date format.

=====================================================================================
Invalid object name 'Message'.
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.Data.SqlClient.SqlException: Invalid object name 'Message'.

Source Error:


Line 463:
Line 464:
Line 465: this.Save(this.oTicket, dsTicket,this.oTicket.TableName );
Line 466:
Line 467: string strPageMode = (string)Session["Ticket_Page_Mode"];


Source File: d:\inetpub\wwwroot\kencrmweb\maintaintickets.aspx.cs Line: 465

Stack Trace:


[SqlException: Invalid object name 'Message'.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) +45
System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +5
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
OakLeaf.MM.Main.Data.mmDataAccessSql.FillDataSet(DataSet ds, IDbDataAdapter dbAdapter, String tableName, Boolean clearOnFill)
OakLeaf.MM.Main.Data.mmDataAccessSql.FillDataSet(DataSet ds, IDbCommand command, String tableName, Boolean clearOnFill)
OakLeaf.MM.Main.Data.mmDataAccessSql.FillDataSet(DataSet ds, String command, String tableName, CommandType cmdType, IDbDataParameter[] dataParms, Boolean clearOnFill)
OakLeaf.MM.Main.Business.mmBusinessObject.FillDataSet(DataSet ds, String command, String tableName, String databaseKey, CommandType cmdType, IDbDataParameter[] dataParams)
OakLeaf.MM.Main.Business.mmBusinessObject.GetDataSet(String command, String tableName, String databaseKey, CommandType cmdType, IDbDataParameter[] dataParams)
OakLeaf.MM.Main.Business.mmBusinessObject.GetDataSet(String command, String tableName, String databaseKey, IDbDataParameter[] dataParams)
OakLeaf.MM.Main.Business.mmBusinessObject.GetDataSet(String command, String tableName, IDbDataParameter[] dataParams)
OakLeaf.MM.Main.Globalization.mmMessageManager.GetAllMessages(Object languagePK)
OakLeaf.MM.Main.Globalization.mmMessageManager.GetMessageCache(Object LanguagePk, Boolean ForceReload)
OakLeaf.MM.Main.Globalization.mmMessageManager.GetMessageCache(Object LanguagePk)
OakLeaf.MM.Main.Globalization.mmMessageManager.GetMessage(String messageKey, Object languagePK, Boolean returnMessageKeyIfNotFound)
OakLeaf.MM.Main.Globalization.mmMessageManager.GetMessage(String messageKey, Object languagePK)
OakLeaf.MM.Main.Web.UI.mmBusinessWebPage.AddBrokenRuleForControl(ImmWebBindingSimple control, String name, String errorText)
OakLeaf.MM.Main.Web.UI.mmWebDataHelper.AddBrokenRuleForControl(ImmWebBindingSimple control, String name, String errorText)
OakLeaf.MM.Main.Web.UI.WebControls.mmTextBox.BindBack(DataSet ds, String tableName, String fieldName)
OakLeaf.MM.Main.Web.UI.mmWebBindingStrategySimple.BindData(ImmWebBindingSimple mmControl, mmBusinessObject bizObj, Boolean bindBack, mmBusinessStateChangeEventArgs e)
OakLeaf.MM.Main.Web.UI.mmWebBindingStrategySimple.BindData(ImmWebBindingSimple mmControl, mmBaseBusinessObject bizObj, Boolean bindBack, mmBusinessStateChangeEventArgs e)
OakLeaf.MM.Main.Web.UI.WebControls.mmTextBox.StateChangeHandler(mmBaseBusinessObject bizObj, mmBusinessStateChangeEventArgs e)
OakLeaf.MM.Main.Business.mmBusinessStateChangeDelegate.Invoke(mmBaseBusinessObject bizObj, mmBusinessStateChangeEventArgs e) +0
OakLeaf.MM.Main.Business.mmBusinessObject.OnStateChange(mmBusinessState bizState, String tableName, Object primaryKeyValue, Object[] primaryKeyValues)
OakLeaf.MM.Main.Business.mmBusinessObject.CallStateChange(mmBusinessState bizState, String tableName, DataRow dr)
OakLeaf.MM.Main.Business.mmBusinessObject.CallStateChange(mmBusinessState bizState, String tableName)
OakLeaf.MM.Main.Business.mmBusinessObject.PreSaveProcessing(DataSet ds, String tableName)
OakLeaf.MM.Main.Business.mmBusinessObject.SaveDataSet(DataSet ds, String tableName, String databaseKey, IDbDataAdapter dbAdapter)
OakLeaf.MM.Main.Business.mmBusinessObject.SaveDataSet(DataSet ds, String tableName, String databaseKey)
OakLeaf.MM.Main.Business.mmBusinessObject.SaveDataSet(DataSet ds, String tableName)
OakLeaf.MM.Main.Business.mmBusinessObject.SaveDataSet(DataSet ds)
OakLeaf.MM.Main.Web.UI.mmBusinessWebPage.Save(mmBusinessObject bizObj, DataSet ds, String tableName)
Kensington.KenCRMWeb.testticket.cmdSaveTicket2_Click(Object sender, EventArgs e) in d:\inetpub\wwwroot\kencrmweb\maintaintickets.aspx.cs:465
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292


======================================================================


Thanks,

Ilyas
Previous
Reply
Map
View

Click here to load this message in the networking platform