数据库系统代码求助!大神来帮我看下代码。。。。
vb.net吧
全部回复
仅看楼主
level 1
394562300 楼主
Imports System.Data.SqlClient
Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SqlDataAdapter1.Fill(DataSet11, "t_grade")
End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cn As New SqlConnection("Initial Catalog = school;" _
& "Integrated Security = SSPI;")
Dim sql As String = "Select * From t_grade Where studentcode = '" & TextBox1.Text & "'"
Dim ad As SqlDataAdapter = New SqlDataAdapter(sql, cn)
Dim ds As New DataSet()
ad.Fill(ds, "t_grade")
DataGrid1.DataSource = ds.Tables("t_grade ") End Sub
End Class
为什么我点下查询之后一个数据都没有了?这是什么原因啊?大神??!!
2013年06月30日 15点06分 1
level 1
394562300 楼主
自顶!
2013年06月30日 15点06分 2
1