format question

Results 1 to 2 of 2

Thread: format question

  1. #1
    Join Date
    Dec 1969

    Default format question

    Hi,<BR><BR>I&#039;m having some issues while I&#039;m trying to pass the following parameter information:<BR><BR>MyCommand.Parameters.Add(New SqlParameter("@TotSalaryBenefit", SqlDbType.Money, 8))<BR>MyCommand.Parameters("@TotSalaryBenefit").V alue = TotalSalary.Text<BR><BR>And even if I replaced the second line with the following<BR>MyCommand.Parameters("@TotSalaryBenef it").Value = Integer.Parse(TotalSalary.Text)<BR><BR>I still keep getting the following error:<BR>System.FormatException: Input string was not in a correct format.<BR><BR>Any comments/suggestions will be greatly welcomed.<BR><BR>Thanks.

  2. #2
    Join Date
    Dec 1969

    Default RE: format question

    Instead of Integer.Parse try<BR><BR>CCur(TotalSalary.Text)<BR><BR>Compiler is not able to convert Integer in to currency.<BR><BR>Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts