how can i get the value ...which code write in button click event that get my id..
USE DATATABLE

 Public Function inst() As DataTable
        Dim tb2 As New DataTable
        Dim st As String
        Dim dfsty As DataSet
        Dim df As New SqlClient.SqlDataAdapter



        Try

            cn.Open()
            st = "SELECT EmMaster_EmploId FROM(EmMaster) WHERE EmMaster_EmploId=(SELECT max(EmMaster_EmploId) FROM EmMaster)"
            df = New SqlDataAdapter(st, cn)
            df.Fill(dfsty, "EmMasater")
            tb2 = dfsty.Tables(0)
            cn.Close()




        Catch ex As Exception
            MessageBox.Show(ex.Message)
        Finally
            cn.Close()

        End Try
        Return tb2


    End Function

    Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnSave.Click

        Try
            Dim dss As DataTable
            dss = inst()

LIKE THIS

 txtEmMaster_Id.Text = ds.Rows(0).Item("EmMaster_ID")
This question has already been answered. Start a new discussion instead.