Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   HELP With DataList (http://www.velocityreviews.com/forums/t775031-help-with-datalist.html)

CCORDON 12-16-2004 03:09 PM

HELP With DataList
 
I am using a DataList to load data from a OleDbDataReader but it wont load
the data...I have checked and the DataReader has records in it.

Here is the code:




If Not Me.IsPostBack Then

BiddingsReader =
GetCurrentBiddings(p_UserInformation.UserCorpId)

BiddingsReader.Read()

If BiddingsReader.HasRows Then

lstBiddings.DataSource = BiddingsReader

lstBiddings.DataBind()

lblNoData.Visible = False

lstBiddings.Visible = True

Else

lblNoData.Visible = True

lstBiddings.Visible = False

End If

End If




This code is called in Page_Load

Inside the HTML portion I am using



<%# DataBinder.Eval(Container.DataItem, "Codigo") %>



Where I want the data to appear

Help is appreciated.

Thanks



Ken Cox [Microsoft MVP] 12-19-2004 03:37 AM

Re: HELP With DataList
 
You should get the data into a datatable using a dataadapter. The DataList
isn't going to want to deal with a datareader that way.


"CCORDON" <tcordonb@hotmail.com> wrote in message
news:uNeYvE44EHA.3380@TK2MSFTNGP09.phx.gbl...
>I am using a DataList to load data from a OleDbDataReader but it wont load
>the data...I have checked and the DataReader has records in it.
>
> Here is the code:
>
>
>
>
> If Not Me.IsPostBack Then
>
> BiddingsReader =
> GetCurrentBiddings(p_UserInformation.UserCorpId)
>
> BiddingsReader.Read()
>
> If BiddingsReader.HasRows Then
>
> lstBiddings.DataSource = BiddingsReader
>
> lstBiddings.DataBind()
>
> lblNoData.Visible = False
>
> lstBiddings.Visible = True
>
> Else
>
> lblNoData.Visible = True
>
> lstBiddings.Visible = False
>
> End If
>
> End If
>
>
>
>
> This code is called in Page_Load
>
> Inside the HTML portion I am using
>
>
>
> <%# DataBinder.Eval(Container.DataItem, "Codigo") %>
>
>
>
> Where I want the data to appear
>
> Help is appreciated.
>
> Thanks
>




All times are GMT. The time now is 07:53 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.