如何将移动控件List更sql server2000里的数据绑定
最近小弟在使用做些wap网站方面的东西,但一直弄不懂怎么才能将list跟数据库里面的数据绑定。下面是小弟做的,但还不完整或者是错误的。求安慰大虾救救小弟<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %>
<script>
Dim objectConnection As New SqlConnection("Server=localhost;Database=timetable;user id=root;password=root")
Dim objDataAdapter As New SqlDataAdapter()
Dim objDataSet As New DataSet()
objDataAdapter.SelectCommand = New SqlCommand()
objDataAdapter.SelectCommand.Connection = objectConnection
objDataAdapter. = "SELECT * FROM t_admin"
objDataAdapter. = CommandType.Text
objectConnection.Open()
objDataAdapter.Fill(objDataSet, "admin")
Dim customersTable As DataTable = _
objDataSet.Tables.Add("CustomersTable")
DataGrid1.DataSource = new DataView(customersTable)
DataGrid1.DataBind
objectConnection.Close()
objDataAdapter = Nothing
objectConnection = Nothing
</script>
<html xmlns="http://www. >
<body>
<mobile:Form id="Form1" runat="server">
<mobile:List ID="dataGrid1" Runat="server" >
</mobile:List>
</mobile:Form>
</body>
</html>