asked on
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' This example uses Microsoft SQL Server and connects
' to the Northwind sample database. The data source needs
' to be bound to the GridView control only when the
' page is first loaded. Thereafter, the values are
' stored in view state.
If Not IsPostBack Then
Dim queryString2 As String = _
"Select * From Questions"
' Run the query and bind the resulting DataSet
' to the GridView control.
Dim ds2 As DataSet = GetData(queryString2)
If (ds.Tables.Count > 0) Then
Me.GridView2.DataSource = ds2
Me.GridView2.DataBind()
Else
'Me.Label_Error1.Text = "Unable to connect to the database. " & Err.Description
End If
End If
End Sub