Maybe this isn't possible, because I can't find any compatible solutions. Here's my grid:
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
Here's my onload code...
Protected Sub GridView1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.Load
If Not Page.IsPostBack Then
Dim MyReader As SqlDataReader
Dim MyConnection As SqlConnection = New SqlConnection
MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings("TDRCS_Intranet_Conn").ConnectionString
Dim Mycommand As SqlCommand = New SqlCommand
Mycommand.CommandText = "Select TOP 3 * FROM WebViews"
Mycommand.CommandType = CommandType.Text
Mycommand.Connection = MyConnection
Mycommand.Connection.Open()
MyReader = Mycommand.ExecuteReader(CommandBehavior.CloseConnection)
GridView1.DataSource = MyReader
GridView1.DataBind()
Mycommand.Dispose()
MyConnection.Dispose()
End If
End Sub
______
Without me going through what I've already tried...Can anyone please help me figure out how this is done?
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
Here's my onload code...
Protected Sub GridView1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.Load
If Not Page.IsPostBack Then
Dim MyReader As SqlDataReader
Dim MyConnection As SqlConnection = New SqlConnection
MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings("TDRCS_Intranet_Conn").ConnectionString
Dim Mycommand As SqlCommand = New SqlCommand
Mycommand.CommandText = "Select TOP 3 * FROM WebViews"
Mycommand.CommandType = CommandType.Text
Mycommand.Connection = MyConnection
Mycommand.Connection.Open()
MyReader = Mycommand.ExecuteReader(CommandBehavior.CloseConnection)
GridView1.DataSource = MyReader
GridView1.DataBind()
Mycommand.Dispose()
MyConnection.Dispose()
End If
End Sub
______
Without me going through what I've already tried...Can anyone please help me figure out how this is done?