Sub BindAFTGrid() Try Dim sqlcn As New System.Data.SqlClient.SqlConnection(connection_str) Dim strSQL As String = "Select * from AdminFunctionTypes" Dim DS As DataSet Dim MyConnection As New SqlConnection Dim MyCommand As SqlDataAdapter grdAFT.DataSource = "" MyCommand = New SqlDataAdapter(strSQL, sqlcn) DS = New DataSet '("MyDynamicAFT") Try DS.Tables("MyAFT").Clear() Catch ex As Exception ' be sure we get a fresh query End Try MyCommand.Fill(DS, "MyAFT") grdAFT.DataSource = DS.Tables("MyAFT").DefaultView 'Source.Sort = E.SortExpression Page.DataBind() MyConnection.Close() Catch ex As Exception Dim err As New MailError err.eMailError(ex, "AFT Binding") End Try End Sub
"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams