L
Laura K
Can someone tell me where I went wrong. This is my code for binding data to
a datalist.
<script language="vb">
Sub Page_Load(Src As Object, e As EventArgs)
Dim Con As New SqlConnection("server=(PathToDataBase)"; &
"database=name;User ID=UID;Password=password")
Dim myCommand As New SqlDataAdapter
myCommand= ("select distinct strSubCategory from tblProducts", con)
Dim dgDataset = New DataSet()
myCommand.Fill(dgDataset)
datalist.DataSource = ds
datalist.DataBind()
end sub
</script>
<aspataList id="datalist" runat="server" HorizontalAlign="Center">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "strSubCategory") %>
</ItemTemplate>
</aspataList>
a datalist.
<script language="vb">
Sub Page_Load(Src As Object, e As EventArgs)
Dim Con As New SqlConnection("server=(PathToDataBase)"; &
"database=name;User ID=UID;Password=password")
Dim myCommand As New SqlDataAdapter
myCommand= ("select distinct strSubCategory from tblProducts", con)
Dim dgDataset = New DataSet()
myCommand.Fill(dgDataset)
datalist.DataSource = ds
datalist.DataBind()
end sub
</script>
<aspataList id="datalist" runat="server" HorizontalAlign="Center">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "strSubCategory") %>
</ItemTemplate>
</aspataList>