找回密码
 立即注册

本文来自

范文频道

范文频道

订阅|关注

爱米村范文频道致力于整理并分享给用户平时常用的范文,比如自我介绍范文,入党申请书范文,个人简历范文,工作总结范文,思想汇报范文等等,要找范文就来文章库范文频道

同济大学SQL数据库实验9

[复制链接]
250 jeromeli 发表于 2017-9-14 01:06:03
导读:ImportsSystem.Data.SqlClientPublicClassForm1PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickDimaAsNewSqlConnection(\Security=True;\)
Imports System.Data.SqlClient Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As New SqlConnection(\Security=True;\)
Dim b As String = \student.snum,cname,score from student,sc,section,course where sc.snum=student.snum and sc.secnum=section.secnum and section.cnum=course.cnum and student.snum='\ & TextBox1.Text.Trim & \ Dim adapter As New SqlDataAdapter(b, a) Dim dataset As New DataSet adapter.Fill(dataset, \)
DataGridView1.DataSource = dataset.Tables(\)
Dim c As String = \ & TextBox1.Text.Trim & \ adapter.SelectCommand.CommandText = c adapter.Fill(dataset, \)
Label2.Text = dataset.Tables(\).Rows(0).Item(0).ToString & \选修课程成绩 \ End Sub End Class


2.Imports System.Data.SqlClient

Public Class Form1
Dim bind As New BindingSource
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
bind.MoveFirst()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
bind.MovePrevious() End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
bind.MoveNext() End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
bind.MoveLast() End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As New SqlConnection(\Security=True;\)
Dim b As String = \student.snum,sname,cname,score from student,sc,section,course where sc.snum=student.snum and sc.secnum=section.secnum and section.cnum=course.cnum and student.snum='\ & TextBox1.Text.Trim & \ Dim adapter As New SqlDataAdapter(b, a) Dim dataset As New DataSet adapter.Fill(dataset, \) bind.DataSource = dataset bind.DataMember = \
TextBox2.DataBindings.Add(New Binding(\, bind, \, True)) TextBox3.DataBindings.Add(New Binding(\, bind, \, True)) TextBox4.DataBindings.Add(New Binding(\, bind, \, True)) TextBox5.DataBindings.Add(New Binding(\, bind, \, True)) End Sub End Class
温馨提示:
1、在论坛里发表的文章仅代表作者本人的观点,与本网站立场无关。
2、论坛的所有内容都不保证其准确性,有效性,时间性。阅读本站内容因误导等因素而造成的损失本站不承担连带责任。
3、若因线路及非本站所能控制范围的故障导致暂停服务期间造成的一切不便与损失,论坛不负任何责任。
4,本网站内容均摘自其他网站,如涉及侵权定当第一时间删除
5、如侵犯您的权益请联系936144721@qq.com



上一篇:市政实务历年真题与专家预测试卷第一部分
下一篇:孩子多大开始教他识字 我感觉一岁半就应该可以识字了
转载请说明出处,本文地址:http://bbs.imicun.com/thread-15465671-1-1.html
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表