0
            con.Open()
        cmd.Connection = con
        dataGrid.SelectedIndex = dataGrid.CurrentItem(0)
        MessageBox.Show("User Has Selected " & dataGrid.SelectedIndex)
        Dim id As Integer = dataGrid.SelectedIndex(0).cells("Appid").value.ToString()
        Dim fname As String = dataGrid.SelectedRows(0).cells("Fname").value.ToString()
        Dim mname As String = dataGrid.SelectedRows(0).cells("Mname").value.ToString()
        Dim lname As String = dataGrid.SelectedRows(0).cells("Lname").value.ToString()
        Dim fthname As String = dataGrid.SelectedRows(0).cells("Fthname").value.ToString()
        Dim mthname As String = dataGrid.SelectedRows(0).cells("Mthname").value.ToString()
        Dim occp As String = dataGrid.SelectedRows(0).cells("Occupation").value.ToString()
        Dim dob As Date = dataGrid.SelectedRows(0).cells("DOB").value.ToString()
        Dim mbno As String = dataGrid.SelectedRows(0).cells("Mbno").value.ToString()
        Dim emid As String = dataGrid.SelectedRows(0).cells("Emailid").value.ToString()
        Dim addr As String = dataGrid.SelectedRows(0).cells("Address").value.ToString()
        Dim nat As String = dataGrid.SelectedRows(0).cells("Nationality").value.ToString()
1
Contributor
1
Reply
8
Views
6 Months
Discussion Span
Last Post by Shaikh_4
0
            This is the Message Box that should contains the fields of the selected row, but it gives the error on datagrid.selectedRows(0).cells("Mbno").value.ToString()
            MessageBox.Show(id & "," & fname & "," & mname & "," & lname & "," & fthname & "," & mthname & "," & occp & "," & dob & "," & mbno & "," & emid & "," & addr & "," & nat)
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.