Thanks for your suggestion.
I recheck my code as per your suggestion.But unable to find the problem.I used following table.Can you suggest me at which point
my code is wrong.
Using connection As New SqlConnection("Data Source=RAKESH\SQLEXPRESS;Initial Catalog=PO;Integrated Security =True")
Dim str As String = "SELECT Item_name FROM Item_Master where Item_no = '@selectedItemNo'"
Dim command As New SqlCommand(str, connection)
connection.Open()
command.Parameters.AddWithValue("@selectedItemNo", cmbItemName.SelectedValue.ToString())
Try
rd = command.ExecuteReader
If rd.Read = True Then
txtItem_code.Text = rd("Item_no")
End If
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
con.Close()
End Using