Dim squery As String = "SELECT name,days from definedLeave" Dim cmd6 As SqlCommand = New SqlCommand(squery, con) Dim dr6 As SqlDataReader = cmd6.ExecuteReader() Dim i As Integer = 0 While dr6.Read() Try s = dr6(i).ToString TextBox14.Text = s a = dr6(i + 1).ToString TextBox12.Text = a Dim sql = "update empLeave set " & TextBox14.Text.Trim & "=@na where epid='" + txtCode.Text + "'" Using com7 = New SqlCommand(sql, con) com7.Parameters.AddWithValue("@na", TextBox12.Text) com7.ExecuteNonQuery() End Using Catch ex As Exception MsgBox("HELLO") End Try End While com7.Dispose() dr6.Close()
com7.Dispose
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)