asp中用后台运行时,错误提示输入字符串的格式不正确。.
longid=Convert.ToInt64(context.Request["Id"]);DataTabledt=SqlHelper.ExecuteDataTable(...
long id = Convert.ToInt64(context.Request["Id"]);
DataTable dt = SqlHelper.ExecuteDataTable("select * from test where ID=@Id",
new SqlParameter("@Id", id));
每次执行到 DataTable dt = SqlHelper.ExecuteDataTable("select * from test where ID=@Id",new SqlParameter("@Id", id));这句时就会出现格式不正确 展开
DataTable dt = SqlHelper.ExecuteDataTable("select * from test where ID=@Id",
new SqlParameter("@Id", id));
每次执行到 DataTable dt = SqlHelper.ExecuteDataTable("select * from test where ID=@Id",new SqlParameter("@Id", id));这句时就会出现格式不正确 展开
2个回答
展开全部
long id = Convert.ToInt64(context.Request["Id"]);
SqlParameter[] parameters = {
new SqlParameter("@newsId", SqlDbType.BigInt)
};
parameters[0].Value =id;
DataTable dt = SqlHelper.ExecuteDataTable("select * from test where ID=@Id", parameters);
SqlParameter[] parameters = {
new SqlParameter("@newsId", SqlDbType.BigInt)
};
parameters[0].Value =id;
DataTable dt = SqlHelper.ExecuteDataTable("select * from test where ID=@Id", parameters);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询