标题:本人刚学ASP.NET。有个操作数据库的问题,求教
只看楼主
l770959276
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2013-11-10
结帖率:0
已结贴  问题点数:20 回复次数:1 
本人刚学ASP.NET。有个操作数据库的问题,求教
运行后的截图
程序代码:
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim constr As String = "provider=microsoft.jet.OLEDB.4.0;data source=e:\web_work\student.mdb"
        Dim conn As New OleDbConnection(constr)
        Dim sqlstr As String = "update stuInfo set SNO=" & TextBox1.Text & ",name='" & TextBox2.Text & "',sex='" & TextBox3.Text & "',age=" & TextBox4.Text & ",birth=" & Convert.ToInt32(TextBox5.Text) & ",class='" & TextBox6.Text & "',grade='" & TextBox7.Text & "',专业='" & TextBox8.Text & "',address='" & TextBox9.Text & "',简介='" & TextBox10.Text & "' where SNO='" & TextBox11.Text & "'"
        Dim cmd As New OleDbCommand()
         = sqlstr
        cmd.Connection = conn
        conn.Open()
        cmd.ExecuteNonQuery()
        conn.Close()

插入和更新数据提示出错,不知如何修改
搜索更多相关主题的帖子: Object 数据库 color 
2013-11-10 23:39
yms123
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
得分:20 
你最好输出一下SQL语句看看能输出什么,先排除SQL语句的错误
2013-11-12 10:01



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-423345-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.057186 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved