Hi,<BR><BR>I am trying to create a search function using a data reader to display the information regarding a particular division. In the code below the user can get this information by entering the Division data, but I want to change it so that the user searches based on the Division Name. Also, the division field is suppose to be an autonumber on the Divisions Sql table. <BR><BR>The code is as follows:<BR><BR><BR>Private Sub cmdSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSearch.Click<BR> Dim getDiv As String<BR> getDiv = "SELECT Division, Description FROM dbo.Divisions where division=@Division"<BR><BR> Dim MyCommand As New SqlCommand(getDiv, MyConnection)<BR> MyCommand.Parameters.Add(New SqlParameter("@Division", SqlDbType.NVarChar, 2))<BR> MyCommand.Parameters("@Division").Value = txtdiv.Text.ToString<BR> MyConnection.Open()<BR><BR> Dim MyReader As SqlDataReader<BR> Try<BR> MyReader = MyCommand.ExecuteReader()<BR> If MyReader.HasRows Then<BR> Do While MyReader.Read()<BR> txtdiv.Text = MyReader.GetString(0).ToString<BR> txtDes.Text = MyReader.GetString(1).ToString.ToUpper<BR> Loop<BR> Else<BR> Message.InnerHtml = "ERROR. Not Data found for that division"<BR> End If<BR> MyReader.Close()<BR> Catch ex As Exception<BR> Message.InnerHtml = " ERROR: That Division doesn&#039;t exists!"<BR> End Try<BR><BR> End Sub<BR><BR>Any comments and suggestions will be greatly welcomed.<BR><BR>Tks.<BR><BR>Ferruti :)