G
Guest
Can someone please tell me why I keep getting the error!
There is no row at position 0
Dim row As DataRow = table.Rows(0)
I know it has something to do with the value of rowID because if I set rowID
as a fixed value rather than using a querystring it works!
Any ideas???
Thanks
Private rowID As Integer
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Get Text for Editor
If Not Page.IsPostBack Then
FreeTextBox1.Text = GetDocument()
End If
rowID = Request.QueryString(ID)
End Sub 'Page_Load
Public Sub Button_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
UpdateDocument(FreeTextBox1.Text)
End Sub 'Button_Click
Private Function GetDocument() As String
Dim ds As DataSet = GetDataSet(("SELECT * FROM tblPageContent WHERE
pageID=" + rowID.ToString()))
Dim table As DataTable = ds.Tables(0)
Dim row As DataRow = table.Rows(0)
Dim doc As String = row("content").ToString()
Return doc
End Function 'GetDocument
There is no row at position 0
Dim row As DataRow = table.Rows(0)
I know it has something to do with the value of rowID because if I set rowID
as a fixed value rather than using a querystring it works!
Any ideas???
Thanks
Private rowID As Integer
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Get Text for Editor
If Not Page.IsPostBack Then
FreeTextBox1.Text = GetDocument()
End If
rowID = Request.QueryString(ID)
End Sub 'Page_Load
Public Sub Button_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
UpdateDocument(FreeTextBox1.Text)
End Sub 'Button_Click
Private Function GetDocument() As String
Dim ds As DataSet = GetDataSet(("SELECT * FROM tblPageContent WHERE
pageID=" + rowID.ToString()))
Dim table As DataTable = ds.Tables(0)
Dim row As DataRow = table.Rows(0)
Dim doc As String = row("content").ToString()
Return doc
End Function 'GetDocument