Imports System.Data Partial Class controls_twitView Inherits System.Web.UI.UserControl Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender If Not IsPostBack Then Dim dts As New DataSet 'Try Dim obj As New twittyLink dts = obj.apiConnection2() For Each dr As DataRow In dts.Tables(1).Rows Dim str As String = dr("text") If str.Length > 10 Then str = Trim(str) If str.LastIndexOf("http") > 7 And str.LastIndexOf("http") < str.Length - 1 Then Dim url As String = str.Substring(str.LastIndexOf("http"), (str.Length) - str.LastIndexOf("http")) url = "" & url & "" str = str.Remove(str.LastIndexOf("http"), (str.Length) - str.LastIndexOf("http")) str = str & url dr("text") = str End If End If Dim datetimestr() As String = dr("created_at").ToString.Replace(" +0000 2009","").Split(" ") Dim day As String = datetimestr(0) Dim month As String = datetimestr(1) Dim daynumber As String = datetimestr(2) Dim unformattedtime As DateTime = datetimestr(3) unformattedtime = DateAdd("h", -6, unformattedtime) Dim formattedtime As String = unformattedtime.toString("h:mmtt") dr("created_at") = day & " " & month & " " & daynumber & " " & formattedtime Next gvTwittView.DataSource = dts.Tables(1) gvTwittView.DataBind() 'Catch ex As Exception ' dts.Tables.Add("emptyStr") ' gvTwittView.DataSource = dts.Tables("emptyStr") ' gvTwittView.DataBind() 'End Try End If End Sub End Class