Dim cmd As New SqlClient.SqlCommand() Dim rdr As New SqlClient.SqlDataAdapter() rdr.TableMappings.Add("table", "tmpgraphic") Dim ds As DataSet cmd.Connection = cnn cmd.CommandText = "select sgrastyno,sgratype from stylegraphic where sgrastyno='test'" Try cnn.Open() rdr.SelectCommand = cmd ds = New DataSet("Graphic") rdr.Fill(ds) dg.DataSource = ds dg.DataBind() If ds.Tables("tmpgraphic").Rows.Count = 1 Then 为什么在这里出问题? Beep() End If
DataSet.Tables["yourTable"].Rows.Count
Dim rdr As New SqlClient.SqlDataAdapter()
rdr.TableMappings.Add("table", "tmpgraphic")
Dim ds As DataSet cmd.Connection = cnn
cmd.CommandText = "select sgrastyno,sgratype from stylegraphic where sgrastyno='test'"
Try
cnn.Open()
rdr.SelectCommand = cmd
ds = New DataSet("Graphic") rdr.Fill(ds)
dg.DataSource = ds
dg.DataBind() If ds.Tables("tmpgraphic").Rows.Count = 1 Then 为什么在这里出问题?
Beep()
End If