求助 谢谢谢谢谢谢谢谢

yuyyuyyyuyyyyu yuyyuyyyuyyyyu 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我编了一个学生成绩录入程序但有错误,不会修改,请帮帮忙
Public Class Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim id, name, age, grade As String
Dim count As Integer
id = Trim(TextBox1.Text)
name = Trim(TextBox2.Text)
grade = Trim(TextBox3.Text)
age = Trim(TextBox4.Text)

If id = "" Then
MessageBox.Show("学号不能为空")
Return
End If

Dim com As OleDb.OleDbCommand
Dim dr As OleDb.OleDbDataReader ' cmd.CommandText = _
' "SELECT * FROM Titles JOIN Publishers " _
' & "ON Publishers.PubId = Titles.PubID " _
' & "WHERE Publishers.State = 'CA'"
com = New OleDb.OleDbCommand
Dim conn As New OleDb.OleDbConnection

com.CommandText = _
("select count * from student " _
& "where student.id="id"") 错误提示:应为")"

com.Connection = Conn
Conn.open()
dr = com.ExecuteReader
dr.Read()
count = dr.GetValue(0)
dr.Close()
If count <> 0 Then
MessageBox.Show("学号重复!请确认")
Else
com=new OleDb.OleDbCommand ("insert into student(id,name,age,grade)values("id"','"&name&"','"&age&"','"&grade&"')"),conn) 错误提示:应为逗号、“)”或有效的表达式继续符


End If
com.Dispose()
conn.close()
End Sub
End Class


Public Class Form3

Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim conn As New OleDb.OleDbConnection
Dim com As New OleDb.OleDbCommand("select course from course order by c_id".conn)
Dim dr As OleDb.OleDbDataReader 错误提示:"conn"不是"string"的成员

Dim course As String

Private Sub TextBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If e.KeyValue = 13 Then
Dim id As String
Dim count As Integer
id = Trim(TextBox1.Text)
Dim com As New OleDb.OleDbCommand
dim com as New OleDb.OleDbCommand("select count(*)from student where id='"&id&"'",conn)
Dim dr As OleDb.OleDbDataReader 错误提示:应为逗号、“)”或有效的表达式继续符



End If
End Sub


Private Sub OleDbConnection1_InfoMessage(ByVal sender As System.Object, ByVal e As System.Data.OleDb.OleDbInfoMessageEventArgs) Handles OleDbConnection1.InfoMessage

End Sub
End Class

Public Class Form5

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim id, course As String
id = Trim(TextBox1.Text)
course = Trim(ComboBox1.SelectedItem)
If id = "" Then
MessageBox.Show("请输入学号!")
Return

End If
If course = "" Then
MessageBox.Show("请选择课程!")
Return
End If
Dim com As New OleDb.OleDbCommand
Dim dr As OleDb.OleDbDataReader
Dim conn As New OleDb.OleDbConnection
com.Connection = conn
com.CommandText = _
"select mark from stumark,student where stumark.id=student.id and student.id='" _
id"'and stumark.c_id=(select c_id from course where course='"&course&") _

错误提示:应为语句结束
conn.open()
dr = com.ExecuteReader
dr.Read()
TextBox4.Text = Trim(dr.GetString(0))
dr.Close()
com.Dispose()
conn.close()
Button1.Enabled = True

End Sub












...全文

相关推荐

大学生心理求助态度与心理求助行为的关系研究.docx

【大学生心理求助态度与心理求助行为的关系研究】这篇研究报告探讨了大学生在面对心理困扰时,其心理求助态度与实际求助行为之间的联系。

科技之佳

网络游戏-基于lora网络的求助杆及求助系统.zip

**求助系统设计**:详述求助系统的架构,包括硬件(如求助杆)、软件(信号处理和传输)、用户界面和后台管理系统等组成部分。5.

programyg

基于ZigBee技术的门铃及老人求助系统

《基于ZigBee技术的智能门铃及老人求助系统》随着科技的进步,智能家居产品逐渐进入人们的生活,其中,基于ZigBee技术的门铃及老人求助系统以其人性化的功能设计,解决了传统门铃及老人求助的局限性。

weixin_38716519

校园应急管理数字求助对讲系统.doc

二、对讲求助点的分布1.2.1 校园对讲求助:对讲求助点应覆盖校园的主要区域,如教学楼、图书馆、宿舍区、操场、食堂等人员密集场所。这些地点设置的求助按钮应易于识别和操作,确保在紧急情况下能被迅速触发。

evemoney

通信与网络中的地铁站内无线乘客求助系统设计方案

"通信与网络中的地铁站内无线乘客求助系统设计方案"地铁站内无线乘客求助系统是现代城市交通中不可或缺的一部分,它旨在提供快速、可靠的乘客求助服务,同时简化安装和维护过程。针对这一需求,设计了一种基于

weixin_38707240
评论 9
收藏 已收藏
分享
返回顶部
yuyyuyyyuyyyyu
VB 16,718 成员 110,520 内容