一个问题如何将多个查询结果值存储或返回到多个变量中.. 我正在使用一个返回 4 列的查询,但是如何.. 将这些结果单独存储到 4 个单独的变量中.. 这是我的代码
Private Sub FrmAlumnos_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) 处理 MyBase.Load txtCurrentUser.Text = Login.txtUser.Text
Dim strsql As String
strsql = "SELECT ""Agregar"", ""Modificar"", ""Eliminar"", ""Imprimir"" FROM ""Seguridad"".""GrupoPantallas"" WHERE ""IdGrupo"" = (SELECT ""IdGrupo"" FROM ""Seguridad"".""Users"" WHERE ""IdUsers"" = '" _
+ Me.txtCurrentUser.Text + "') AND ""IdPantalla"" = '" + Me.Name + "'"
Try
Using conexion As New Devart.Data.PostgreSql.PgSqlConnection(My.Settings.CNX_Principal)
Dim comando As New Devart.Data.PostgreSql.PgSqlCommand(strsql, conexion)
conexion.Open()
Dim registro As Devart.Data.PostgreSql.PgSqlDataReader = comando.ExecuteReader
If comando.ExecuteReader.Item(0) = 0 Then
btnNew.Visible = False
End If
If comando.ExecuteReader.Item(1) = 0 Then
btnEdit.Visible = False
End If
If comando.ExecuteReader.Item(2) = 0 Then
btnDelete.Visible = False
End If
If comando.ExecuteReader.Item(3) = 0 Then
btnPrint.Visible = False
End If
End Using
Catch ex As Exception
End Try
End Sub
我使用 PostgreSQL 只是为了让你知道......