Hi,
In my below code i am getting exception as below:Could you please help me on this
Exception: 'System.Data.DataRowView' does not contain a property with the name 'System.Data.DataRow'.
Imports
SystemImports
System.DataImports
System.Data.SqlClientImports
System.CollectionsPartial
Class VB_ExamInherits System.Web.UI.PageDim num As Integer
Dim a As Integer
Dim ds As New DataSetDim da As New DAPrivate DAException As ExceptionProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadIf Not Page.IsPostBack Thennum = 1
ViewState(
bindgrid(num)
"Num") = numEnd If
End Sub
objCommand.CommandType = CommandType.Text
Protected Sub bindgrid(ByVal num As Integer)Dim objCommand As New SqlClient.SqlCommand("select ans1,ans2,ans3,ans4 from guest.VB_Exam", da.connection)'objCommand.Parameters.AddWithValue("@Num", num)
Dim dap As New SqlDataAdapter(objCommand)Tryda.Check_Conn()
da.connection.Open()
MsgBox(da.connection.State())
dap.Fill(ds)
lblquestions.Text = ds.Tables(0).Rows(0)(0)
Label1.Text = ds.Tables(0).Rows(0)(1)
rad1.DataSource = ds.Tables(0)
rad1.DataBind()
rad1.Text = ds.Tables(0).Rows(0).ToString
'MsgBox("Number of row(s) - " & ds.Tables(2).Rows.Count)
'a = ds.Tables(0).Rows.Count
DAException = ex
Catch ex As ExceptionThrow
End Try
End Sub
num = ViewState(
num = num - 1
bindgrid(num)
Protected Sub imgback_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgback.Click"Num")End Sub
'Function check(ByVal value As String, ByVal value1 As Boolean)
' If RadioButton Then
' Return value1
'End Function
Protected Sub imgnext_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgnext.Click''Dim val As String = ""
''Dim val1 As Boolean
'Dim count As Integer
''check(val, val1)
'If rdans1.Checked = True Then
' If rdans1.Text = ds.Tables(0).Columns(1).ToString Then
' count = count + 1
' End If
' ElseIf
' rdans2.Checked =True then
' If rdans2.Text = ds.Tables(0).Columns(1).ToString Then
' count = count + 1
' End If
' ElseIf
' rdans3.Checked = True
' If rdans3.Text = ds.Tables(0).Columns(1).ToString Then
' count = count + 1
' End If
' ElseIf
' rdans4.Checked = True
' If rdans4.Text = ds.Tables(0).Columns(1).ToString Then
' count = count + 1
' End If
'End Ifnum = ViewState(
"Num")'num = num + 1
Me.bindgrid(num + 1)End Sub
End
Class
Replies
Know the answer? Post it — somebody with the same question will find it here.