vb.net - When is the best time to call a function to change data being returned from the database -


I have two functions written in VB.NET:

1) First task ( It is called GetValues) ()) returns values ​​in a SQL database as a list through a stored proc. One of the fields is the date-time submitted. This data is displayed on my webpage using all a repeater control. It works fine.

2) The second function (this is called a nosidit) I was created to submit date times for a good date like "a minute ago" or "yesterday".

I do not know the problem of my problem, that is the best part of the process of conversion (on data extraction or pageload, etc.) or actually conversion.

I page load try to do some things and started to consider conversion for each loop but so far no dice.

Am I on the right track or is there any easy way?

You can handle the repeater from there, you can use FindControl to get control ( Maybe a label?) And update accordingly according to your nisidit () logic.

Similar to code from the above link, you can do something like: / p>

Edit: Update for VB.NET

  sub myRepeater_ItemDataBound (sender object, such as e RepeaterItemEventArgs) 'this event is raised for the header, footer, separator, and before you check "type: work on items and optional items only . If (e.Item.ItemType = ListItemType.Item) or (e.Item.ItemType = ListItemType.AlternatingItem) then a reference to the 'date labels so its value to get in as dim lblDate updated label = CTYPE (e.Item .FindControl ("LblDate"), label) lblDate.Text = Good date (lblDate.Text) end if ending sub  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -