System.FormatException: 输入字符串的格式不正确。
<%@ import namespace="system.data" %><%@ import namespace="system.data.oledb" %>
<script language="vb" runat="server">
sub page_load(sender as object, e as eventargs)
dim Id as long
dim title as string
title=request("Subject")
Id=request("id")
if title<>"" then
subject.text="re" & title
subject.readonly=true
end if
end sub
sub b1_click(sender as object, e as eventargs)
if page.isvalid then
dim myconnection as oledbconnection=new oledbconnection
dim mycommand as oledbcommand
myconnection.connectionstring="provider=microsoft.jet.oledb.4.0;" & "data source=" &server.mappath(".\") &"db_BBS.mdb"
myconnection.open()
dim strsql as string
strsql="select max(ID) as id from td_card"
mycommand = new OleDbCommand(strsql,myconnection)
dim rd as oledbdatareader
dim maxid as integer
rd=mycommand.executereader()
if isdbnull(rd.read()) then
maxid=rd.item("id")+1
else
maxid=1
end if
rd.close()
strsql="insert into td_card values ('"+maxid+"','"+subject.text+"','"+md.selecteditem.text+"','"+body.text+"','"+sender.text+"')"
mycommand = new OleDbCommand(strsql,myconnection)
mycommand.commandtext=strsql
mycommand.ExecuteNonQuery()
myconnection.close()
response.Write("文章添加成功!")
end if
end sub
sub b2_click(sender as object, e as eventargs)
subject.text=""
body.text=""
end sub
</script>
上段代码的报错是:
"System.FormatException: 输入字符串的格式不正确。"
请问是哪儿出问题了呢.请高手帮我一下,我要急用是发表帖子的程序
--------------------编程问答-------------------- 哪一行代码 --------------------编程问答-------------------- 是不是录入数据库的类型和数据格式不一致!检查一下!
补充:.NET技术 , ASP.NET