向数据库写入数据时,提示 ,输入字符串的格式不正确。

ZHANJUNBIN29 ZHANJUNBIN29 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
“/人事管理系统设计”应用程序中的服务器错误。
--------------------------------------------------------------------------------

输入字符串的格式不正确。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.FormatException: 输入字符串的格式不正确。

源错误:


行 49: publicFunction pFunction = new publicFunction();
行 50:
行 51: int intYuanID = int.Parse(Yuan_ID.Value);

行 52: String strYuanName = Yuan_Name.Value;
行 53:
以下是具体代码,求大神帮忙看看哪里出错了

protected void butSave_Click(object sender, EventArgs e)
{
Yuan_RP yuan_rp = new Yuan_RP();
publicFunction pFunction = new publicFunction();

int intYuanID = int.Parse(Yuan_ID.Value);
String strYuanName = Yuan_Name.Value;

int intRPID = int.Parse(RP_ID.Value);
String strRPName = RP_Name.Value;
float strYuanRPValue = float.Parse(RP_Value.Value);

DateTime dtYuanRPDate = DateTime.Parse(Yuan_RP_Date.Value);

DataTable T_Yuan_RP = (DataTable)Session["T_Yuan_RP"];

yuan_rp.Field_Yuan_ID = intYuanID;
yuan_rp.Field_Yuan_Name = strYuanName;
yuan_rp.Field_RP_ID = intRPID;
yuan_rp.Field_RP_Name = strRPName;
yuan_rp.Field_Yuan_RP_Value = strYuanRPValue;
yuan_rp.Field_Yuan_RP_Date = dtYuanRPDate;
yuan_rp.Field_Yuan_RP_YuanY = Yuan_RP_YuanY.Text;
yuan_rp.Field_Yuan_RP_Memo = Yuan_RP_Memo.Text;

if (Hid_Command.Value == "INSERT")
{
String strReturn = yuan_rp.Yuan_RPInsert();
if (strReturn.Contains("ok"))
{
Response.Redirect("YuanRPView.aspx");
}
}
else if (Hid_Command.Value == "UPDATE")
{
yuan_rp.Field_Int_Yuan_RP_ID = int.Parse(T_Yuan_RP.Rows[int.Parse(Hid_RowIndex.Value)]["Yuan_RP_ID"].ToString());
yuan_rp.RowIndex = int.Parse(Hid_RowIndex.Value);
String strReturn = yuan_rp.Yuan_RPUpdate();
if (strReturn.Contains("ok"))
{
Response.Redirect("YuanRPView.aspx");
}
else if (strReturn.Contains("fail"))
{
lbl_Show.Text = strReturn.Replace("fail", "");
}
}
}
protected void butReturn_Click(object sender, EventArgs e)
{
Response.Redirect("YuanRPView.aspx");
}
}
...全文

相关推荐

QT登录模块,登录时获取txt文件内账号密码进行判断,注册时写入到本地文件user.txt

QT登录模块,登录时获取txt文件内账号密码进行判断,注册时写入到本地文件user.txt

薪薪代码

详细讲解C#在向ACCESS中插入数据时判断数据是否已存在.pdf

比较详细的介绍了C#用SQL语句insert向ACCESS数据库插入数据时判断,数据是否已经在数据库中存在,如果不存在则继续插入。

Libertywx

python做数据库系统-python做一个图书管理系统,数据库:sqlite.pdf

python做数据库系统_python做⼀个图书管理系统,数据库: sqlite 通过输⼊书名,查找book_id,book_id为⾃动增加。 def bor(): book_name=raw_input('请输⼊要借的书名:') if book_name.strip()=='': print u'书名不能为空' return bor() else : sql=''' select book_id from Book where book_name='%s' '''%book_name cur.execute(sql) book=cur.fetchall() book1=book[0][0] a='%d' %book1 print a a='a' if a.isdigit(): b=int(a) else: b='123' print b #print "".join(book[0]) if book : account=raw_input('请输⼊账号:') if account.strip()=='': print '账号不能为空!!!' else : sqll="select user_id from User where account='%s'"%account cur.execute(sqll) acc=cur.fetchall() acc1=acc[0][0] b='%d'%acc1 print b if acc1: #borrow_date='20200303' sqlll='''insert into Borrow(book_id,user_id) values(?,?)''' , (a,b) cur.execute(sqlll) con.commit() cur.execute('select* from Borrow') print cur.fetchall() print '借书成功!!!' else: print u'不存在%s这个账号!!!'%account else: print u'不存在%s这本书!!!'%book_name 天提⽰的错误为: operation parameter must be str or unicode

是空空呀

vb 调用对话框实现access数据库时间格式备份

vb 调用对话框实现access数据库备份,保存数据库时带时间格式 永不重复。需要建立text1,command1,CommonDialog1.三个控件

华文科技

连接ACCESS数据库时发生错误提示:找不到可安装的 ISAM

连接ACCESS数据库时发生错误提示:找不到可安装的 ISAM 检查后发现原来是把Data Source写成 DataSource了

weixin_38610277
评论 7
收藏 已收藏
分享
返回顶部
ZHANJUNBIN29
.NET社区 62,272 成员 668,968 内容