Code Cleric
Perch
Fill: SelectCommand.Connection property has not been initialized. That's my error.. Here's my code...
If you can't tell I'm flying solo here learning .NET... Cut, Paste, Reverse Engineer, Cross finger's... That's the process. I am sure there is something simple here I am not seeing. I had just started to get into 3.0 when I decided to switch to .NET... Basically I am trying to call out all records from the tbl_Menu_Item table that match category 1.. I would then want to display them in my repeater. If anyone can help me out I would greatly appreciate it. Thanks in advance.
Code:
<%@ page language="vb" runat="server"%>
<%@ Import Namespace="System.Data"%>
<%@ Import Namespace="System.Data.OleDb"%>
<script language="vb" runat="server">
sub Page_Load(sender As Object, e As EventArgs)
if Not IsPostBack then
DataSub
end if
end sub
sub DataSub()
Dim myConnection as OleDbConnection
Dim strConnectionString as String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("mwt.mdb")
dim OurCommand as OleDbCommand
dim OurConnection as OleDbConnection
dim OurDataAdapter as OleDbDataAdapter
dim OurDataSet as New DataSet()
OurCommand = New OleDbCommand("Select Name,Price from tbl_Menu_Item Where Category = 1;",OurConnection)
OurDataAdapter = New OleDbDataAdapter(OurCommand)
OurDataAdapter.Fill(OurDataSet, "Categories")
dim OurDataTable as New DataView(OurDataSet.Tables("Categories"))
OurRepeater.DataSource = OurDataTable
OurRepeater.DataBind()
end sub
</script>
If you can't tell I'm flying solo here learning .NET... Cut, Paste, Reverse Engineer, Cross finger's... That's the process. I am sure there is something simple here I am not seeing. I had just started to get into 3.0 when I decided to switch to .NET... Basically I am trying to call out all records from the tbl_Menu_Item table that match category 1.. I would then want to display them in my repeater. If anyone can help me out I would greatly appreciate it. Thanks in advance.