注册 登录
编程论坛 VB.NET论坛

抛出异常System.NullReferenceException怎么办?

qlx_123 发布于 2007-12-25 17:36, 1190 次点击
异常详细信息: System.NullReferenceException
代码如下:dim filename,filepath as string
        filename=Path.GetFileName(uploadfile.Postedfile.FileName)
        filepath= server.mappath("picture") & "\" & filename
        uploadfile.postedfile.saveas(filepath)
        'message.text=filepath

        dim conn as new oledbconnection("provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("piao.mdb"))
        dim cmd as new oledbcommand("insert into movie(m_name,m_jj,m_people,m_dy,m_price,m_time,m_long,m_count,m_picture)values('"& m_name.text &"','"& m_jianjie.text &"','"& m_people.text &"','"& m_dy.text &"'," & csng(m_price.text()) &",#" & cdate(m_time.text) & "#," & csng(m_long.text) & "," & cint(m_count.text) & ",'" & filename & "')",conn)
        conn.open()
        cmd.executenonquery()
        conn.close()
        message.text="已经成功添加!"
2 回复
#2
qlx_1232007-12-25 17:37
有哪位高手可以帮忙,谢谢了
#3
qlx_1232007-12-25 18:41
谢谢各位!
1