Hello,
I have a datareader which binds my datalist. Now, I want to fetch Row #21 lets say and store the data that is in a specific column called "Sound" to a variable. Anyway to do this?
<%@ Page Language="vb" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
' Create a connection to the "pubs" SQL database located
' on the local computer.
Dim strConn as String
dim id, string1
id=request.querystring("id")
string1 = Help!!!
strConn = "server=x;" _
& "database=x;user id=x;pwd=x"
Dim MySQL as string = "SELECT * FROM products" Dim MyConn as New SQLConnection(strConn)
Dim objDR as SQLDataReader
Dim Cmd as New SQLCommand(MySQL, MyConn)
MyConn.Open()
objDR=Cmd.ExecuteReader()
MyDataList.DataSource = objDR
MyDataList.DataBind()
End Sub
</script>
<body>
<aspataList id="mydatalist" HorizontalAlign="Center" cssclass = "wcrussmall" halign="center" ItemStyle-VerticalAlign="Top" itemstyle-horizontalalign= "Center" ItemStyle-Width = "250" repeatlayout="table" cellpadding="4" CellSpacing="2" runat="server">
<asp:Image id="Image1" runat="server" src='<%# DataBinder.Eval(Container.DataItem, ("smallimageurl"))%>'>
</asp:Image
<%# DataBinder.Eval(Container.DataItem, ("description"))%><br>
<%# DataBinder.Eval(Container.DataItem, ("descriptionLong"))%></a></font></a><br>
List Price: <%# DataBinder.Eval(Container.DataItem, ("listprice"), "{0:c}")%><br>Our Price: <%# DataBinder.Eval(Container.DataItem, ("price"), "{0:c}")%><br>
</itemtemplate>
</aspataList></body>
I have a datareader which binds my datalist. Now, I want to fetch Row #21 lets say and store the data that is in a specific column called "Sound" to a variable. Anyway to do this?
<%@ Page Language="vb" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
' Create a connection to the "pubs" SQL database located
' on the local computer.
Dim strConn as String
dim id, string1
id=request.querystring("id")
string1 = Help!!!
strConn = "server=x;" _
& "database=x;user id=x;pwd=x"
Dim MySQL as string = "SELECT * FROM products" Dim MyConn as New SQLConnection(strConn)
Dim objDR as SQLDataReader
Dim Cmd as New SQLCommand(MySQL, MyConn)
MyConn.Open()
objDR=Cmd.ExecuteReader()
MyDataList.DataSource = objDR
MyDataList.DataBind()
End Sub
</script>
<body>
<aspataList id="mydatalist" HorizontalAlign="Center" cssclass = "wcrussmall" halign="center" ItemStyle-VerticalAlign="Top" itemstyle-horizontalalign= "Center" ItemStyle-Width = "250" repeatlayout="table" cellpadding="4" CellSpacing="2" runat="server">
<asp:Image id="Image1" runat="server" src='<%# DataBinder.Eval(Container.DataItem, ("smallimageurl"))%>'>
</asp:Image
<%# DataBinder.Eval(Container.DataItem, ("description"))%><br>
<%# DataBinder.Eval(Container.DataItem, ("descriptionLong"))%></a></font></a><br>
List Price: <%# DataBinder.Eval(Container.DataItem, ("listprice"), "{0:c}")%><br>Our Price: <%# DataBinder.Eval(Container.DataItem, ("price"), "{0:c}")%><br>
</itemtemplate>
</aspataList></body>