Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force Trimming of Varchar Columns Before Save

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
US
Any way to force trimming of varchar columns using this command before saving them? These are being saved in a MySql db. I can always loop thru the rows, but that seems like a hack. New to NySql, anyway to force it there?
Code:
   Dim parameter As MySqlParameter
    Try
      ' Add the parameters for the UpdateCommand.
      command.Parameters.Add("@LastName", MySqlDbType.VarChar, 20, "LastName")
      command.Parameters.Add("@FirstName", MySqlDbType.VarChar, 15, "FirstName")
      command.Parameters.Add("@MiName", MySqlDbType.VarChar, 1, "MiName")
      command.Parameters.Add("@Active", MySqlDbType.Int16, 4, "Active")
      '      Dim parameter As MySqlParameter = command.Parameters.Add("@PhysicianPK", MySqlDbType.Int24, 11, "PhysicianPK")
      parameter = command.Parameters.Add("@PhysicianPK", MySqlDbType.Int24, 11, "PhysicianPK")
      parameter.SourceVersion = DataRowVersion.Original

    Catch ex As Exception
      MessageBox.Show(ex.ToString)
    End Try

Auguy
Sylvania/Toledo Ohio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top