我的程序语言是用VB,我这段代码写好后,运行起来没有提示错误,可是我的DATAGRID控件却没有任何内容
请高手帮我看看
================================================
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="second.aspx.vb" Inherits="second" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>试验</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
}
-->
</style>
<script language="vb" runat="server">
Dim DS As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter
Sub page_load(ByVal Sender As Object, ByVal E As EventArgs)
If (Page.IsValid) Then
MyConnection = New SqlConnection("server=(local); database=pubs; uid=sa; pwd=sa; Trusted_Connection=yes")
MyCommand = New SqlDataAdapter("select * from titlesl where where price <> 0", MyConnection)
DS = New DataSet()
MyCommand.Fill(DS, "Titles")
dategrid1.DataSource = DS.Tables("Titles").DefaultView
dategrid1.DataBind()
End If
MyConnection.Close()
End Sub
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:DataGrid ID="dategrid1" runat="server"></asp:DataGrid>
</form>
</body>
</html>
=============================================
谢谢了,请指教