ODBC & Datagrid fejl
Kode:<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Odbc" %>
<%@ Import Namespace="System.Web.UI" %>
</script language="vb" runat="server">
Public Sub Page_Load (obj As Object, e As EventArgs)
If Not Page.IsPostBack Then
Dim objConn As New ODBCConnection("DSN=SOURCE")
Dim objDA As New ODBCDataAdapter
Dim dvw As DataView
Dim ds As New DataSet
objDA = New ODBCDataAdapter("SELECT * FROM MyTable", objConn)
objDA.Fill(ds, "MyTable")
dvw = ds.Tables("MyTable").DefaultView
MyDataGrid.DataSource = dvw
MyDataGrid.DataBind()
End If
End Sub
</script>
Fejl:
Compiler Error Message: BC30451: Name 'MyDataGrid' is not declared.