使用vb.net在数据库中找不到行

时间:2017-04-02 13:28:02

标签: vb.net rows

我正在搜索其数据与我的textbox1相同的行,但它显示的错误如下所示。

Error snippet
Database Snippet

代码:

Imports System.Data.SqlClient
Imports WindowsApplication1.BBSRSDataSet1

Public Class CirricularDetails

    Private Sub CirricularDetails_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    End Sub

    Public Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
        '   Dim i As Integer
        Dim a As String = "IEEE"
        Dim x As Integer = 3
        Try
            databaseconnection()
            Dim sql As String = "SELECT COUNT(*) AS rowscount FROM Curriculardb"
            sqlinsertcommand = New SqlCommand(sql, connection)
            Try
                Dim count As Int16 = Convert.ToInt16(sqlinsertcommand.ExecuteScalar())
                '  BBSRSDataSet1.Tables(0).rows(count).cells(index2) = "TRUE" Then
                MsgBox(count.ToString())
                ' For i = 0 To count - 1 Step 1 Field(Of CurriculardbDataTable)("IEEE")
                Dim BBSRSDataSet1 = New BBSRSDataSet1
                For i = 0 To count - 1
                    If BBSRSDataSet1.Tables("Curriculardb").Rows(1).ToString = TextBox1.Text Then
                        MsgBox("Record found")
                    End If
                Next

            Catch ex As SqlException
            End Try
        Catch ex As SqlException
        End Try
    End Sub

0 个答案:

没有答案