'Start transaction
Connection.BeginTransaction
'Set parameter values
Command.AddParameter("def")
Command.SetParameter("def", kod2)
command.AddParameter("n")
command.SetParameter("n", kod3&"000")
Command.CommandText="SELECT * FROM mtt_codes WHERE def=@def AND n<@n AND k>@n"
'Fetch data
Reader.Value = Command.ExecuteReader
'Assign data
If Reader.ReadNextRow = True Then
Label1.Text = Reader.GetValue(5) & CRLF & Reader.GetValue(6) & CRLF & Reader.GetValue(0)
End If
Reader.Close
' End transaction
Connection.EndTransaction