<%@ Page Language="VB" %>
<%@ import Namespace="System.Configuration" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
Dim myDSource As New SqlDataSource
With myDSource
.ConnectionString = System.Configuration.ConfigurationSettings.AppSettings("ConnectionString")
.SelectCommand = "SELECT * FROM [customer]"
End With
Me.myGridView.DataSource = myDSource
Me.myGridView.DataBind()
End Sub
</script>
<html>
<head>
<title>ThaiCreate.Com ASP.NET - SqlDataSource</title>
</head>
<body>
<form id="form1" runat="server">
<asp:GridView id="myGridView" runat="server" AutoGenerateColumns="True"></asp:GridView>
</form>
</body>
</html>