输入字符串的格式不正确。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.FormatException: 输入字符串的格式不正确。源错误:
行 308: }
行 309: DataTable table = GenericDataAccess.ExecuteSelectCommand(comm);
行 310: int howManyProducts =Int32.Parse(comm.Parameters["@HowManyResults"].Value.ToString());
行 311: howManyPages = (int)Math.Ceiling((double)howManyProducts /
行 312: (double)BalloonShopConfiguration.ProductsPerPage);
源文件: d:\我做的VB项目\Shopping\App_Code\CatalogAccess.cs 行: 310 堆栈跟踪:
[FormatException: 输入字符串的格式不正确。]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2753235
System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +102
System.Int32.Parse(String s) +20
CatalogAccess.Search(String searchString, String allWords, String pageNumber, Int32& howManyPages) in d:\我做的VB项目\Shopping\App_Code\CatalogAccess.cs:310
ProductsList.PopulateControls() in d:\我做的VB项目\Shopping\UserControls\ProductsList.ascx.cs:32
ProductsList.Page_Load(Object sender, EventArgs e) in d:\我做的VB项目\Shopping\UserControls\ProductsList.ascx.cs:17
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +31
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +68
System.Web.UI.Control.OnLoad(EventArgs e) +88
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Control.LoadRecursive() +158
System.Web.UI.Control.LoadRecursive() +158
System.Web.UI.Control.LoadRecursive() +158
System.Web.UI.Control.LoadRecursive() +158
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3036
一按搜索就出现错误,是什么问题啊????
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.FormatException: 输入字符串的格式不正确。源错误:
行 308: }
行 309: DataTable table = GenericDataAccess.ExecuteSelectCommand(comm);
行 310: int howManyProducts =Int32.Parse(comm.Parameters["@HowManyResults"].Value.ToString());
行 311: howManyPages = (int)Math.Ceiling((double)howManyProducts /
行 312: (double)BalloonShopConfiguration.ProductsPerPage);
源文件: d:\我做的VB项目\Shopping\App_Code\CatalogAccess.cs 行: 310 堆栈跟踪:
[FormatException: 输入字符串的格式不正确。]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2753235
System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +102
System.Int32.Parse(String s) +20
CatalogAccess.Search(String searchString, String allWords, String pageNumber, Int32& howManyPages) in d:\我做的VB项目\Shopping\App_Code\CatalogAccess.cs:310
ProductsList.PopulateControls() in d:\我做的VB项目\Shopping\UserControls\ProductsList.ascx.cs:32
ProductsList.Page_Load(Object sender, EventArgs e) in d:\我做的VB项目\Shopping\UserControls\ProductsList.ascx.cs:17
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +31
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +68
System.Web.UI.Control.OnLoad(EventArgs e) +88
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Control.LoadRecursive() +158
System.Web.UI.Control.LoadRecursive() +158
System.Web.UI.Control.LoadRecursive() +158
System.Web.UI.Control.LoadRecursive() +158
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3036
一按搜索就出现错误,是什么问题啊????
解决方案 »
- 关于文件缓存依赖的问题~~求助
- 用HttpUtility.UrlEncode()不能给数字加密吗?
- gridview 分页查询无效
- 各位大哥还记得自己面试时,公司出的技术题目不?(ASP.NET)
- SQL存储过程中使用变量的问题,总是提示对象名 'table1' 无效。
- 求助,,,,编译器错误信息: CS0117: “ASP.zhuce2_aspx”并不包含对“RequiredFieldValidator3”的定义
- 很强的在线音乐试听,防下载系统-探讨防下载技术
- 保存文本的简单问题
- 有关实现DropDownList自动匹配的问题
- 用RSA的派生类进行加密解密的操作,出现这样的错误,该如何改正,请帮忙
- 怎么将设置为password 属性的textbox 的值传入数据库?
- [极度敏感话题讨论]软件开发成本问题。。。
d:\我做的VB项目\Shopping\App_Code\CatalogAccess.cs 行: 310
输入格式不正确
行 310: int howManyProducts =Int32.Parse(comm.Parameters["@HowManyResults"].Value.ToString());
可能无法转换成int32
像这种转换的之类.最好是用Convert来转换.
(@Word VARCHAR(15),
@Phrase VARCHAR(1000))
RETURNS SMALLINT
AS 是写的一个数据存储过程 HowManyResults的格式是 SMALLINT
无论什么情况下都会有值而不是null吗?
参数
@DescriptionLength(ing,输入,无默认值)
@PageNumber(tinyint,输入,无默认值)
@ProductsPerPage(tinyint,输入,无默认值)
@HowManyResult(smallint,输入/输出,无默认值)
@AllWords(bit,输入,无默认值)
@Word1(varchar(15),输入,无默认值)
@Word2(varchar(15),输入,无默认值)
@Word2(varchar(15),输入,无默认值)
@Word2(varchar(15),输入,无默认值)
@Word2(varchar(15),输入,无默认值)
返回integer标量值函数
dbo.WordCount
参数
@Word(varchar(15),无默认值)
@Phrase(varchar(1000),无默认值)
dbo.SearchCatalog
参数
@DescriptionLength(int,输入,无默认值)
@PageNumber(tinyint,输入,无默认值)
@ProductsPerPage(tinyint,输入,无默认值)
@HowManyResult(smallint,输入/输出,无默认值)
@AllWords(bit,输入,无默认值)
@Word1(varchar(15),输入,无默认值)
@Word2(varchar(15),输入,无默认值)
@Word2(varchar(15),输入,无默认值)
@Word2(varchar(15),输入,无默认值)
@Word2(varchar(15),输入,无默认值)
返回integer 标量值函数
dbo.WordCount
参数
@Word(varchar(15),无默认值)
@Phrase(varchar(1000),无默认值)