Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9139711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:25:24+00:00 2026-06-17T09:25:24+00:00

I try to search data records in sql database using cmbo box. It shows

  • 0

I try to search data records in sql database using cmbo box. It shows error “The multi-part identifier “System.Data.DataRowView” could not be found” after this “Incorrect Syntax near’='”. My code is given below.

 Private Sub BTNEDIT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNEDIT.Click
    refreshComboBox()
    CMBID.SelectedText = "Select"
 End Sub

 Private Sub refreshComboBox()
    getConnect()
    Try
        Conn.Open()
        Dim strSQL As String = "SELECT * FROM EMPLOYEE ORDER BY EMP_ID ASC"
        Dim da As New SqlDataAdapter(strSQL, Conn)
        Dim ds As New DataSet
        da.Fill(ds, "EMPLOYEE")
        CMBID.DataSource = ds.Tables(0)
        CMBID.DisplayMember = "EMP_ID"
        CMBID.ValueMember = "ID"
        CMBID.SelectedValue = 0
        CMBID.Invalidate()
    Catch ex As Exception
        MessageBox.Show(ex.Message)
    Finally
        Conn.Close()
    End Try
End Sub

Private Sub CMBID_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CMBID.SelectedIndexChanged
    Dim gend As String
    getConnect()
    Dim strSQL As String = "SELECT * FROM EMPLOYEE WHERE EMP_ID=" & CMBID.Text & ""
    Try
        Dim da As SqlDataAdapter = New SqlDataAdapter(strSQL, Conn)
        Dim ds As DataSet = New DataSet
        da.Fill(ds, "EMPLOYEE")
        Dim dt As DataTable = ds.Tables("EMPLOYEE")
        Dim row As DataRow
        For Each row In dt.Rows
            ID.Text = row("ID")
            TXTNAME.Text = row("EMP_NAME")
            TXTFNAME.Text = row("EMP_FNAME")
            gend = row("EMP_GENDER")
            If gend = "MALE" Then
                RBMALE.Checked = True
                RBFEMALE.Checked = False
            ElseIf gend = "FEMALE" Then
                RBFEMALE.Checked = True
                RBMALE.Checked = False
            End If
            DTPEMPDOB.Value = row("EMP_DOB")
            TXTCASTE.Text = row("EMP_CAST")
            CMBDEPT.Text = row("EMP_DEPART")
            CMBDESIG.Text = row("EMP_DESIG")
            DTPEMPDOJ.Value = row("EMP_DOJ")
            MTXTSAL.Text = row("EMP_SALARY")
            MTXTPFESI.Text = row("EMP_PF_ESI")
            TXTBRANCH.Text = row("EMP_BRANCH")
            MTXTCONTACT.Text = row("EMP_CONTACT")
            RTXTADDRESS.Text = row("EMP_ADDRESS")
        Next row
    Catch ex As Exception
        MessageBox.Show(ex.Message)
    Finally
        Conn.Close()
    End Try
End Sub

Please try to check my code and give me solution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:25:24+00:00Added an answer on June 17, 2026 at 9:25 am
        Dim strSQL As String = "SELECT * FROM EMPLOYEE ORDER BY EMP_ID ASC"
        Dim da As New SqlDataAdapter(strSQL, Conn)
        Dim ds As New DataSet
        da.Fill(ds, "EMPLOYEE")
        CMBID.DataSource = ds.Tables(0)
        CMBID.DisplayMember = "EMP_ID"
        CMBID.ValueMember = "ID"
        CMBID.SelectedValue = Nothing
        //CMBID.Invalidate()
    
    
    
    Private Sub CMBID_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CMBID.SelectedIndexChanged
    {
      If clientComboBox.SelectedValue Is Nothing Then
    Return
      End If
    
      If CMBID.SelectedValue.toString() = "System.Data.DataRowView" Then
    Return
      End If
       //Do stuff
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

when I try to search my database for a specific entry by using 'Washing
I'm getting a nothing to repeat error when I try to compile this: search
When i try to search in row POINTA (text data type in SQLite) and
I'm trying to search data on database based on 2 conditions (entryId=rowId & category=cat_id)
When I try to search something like C&A the only query I get in
When I try to search a string starting with the slash / character in
I have an XML document that I load in and try to search with
Possible Duplicate: Memory overhead of Java HashMap compared to ArrayList I try to search
just to put it out there -I really did search and try to find
I try to get notification when the Search button is clicked in the keyboard

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.