[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.sqlserver.programming

Input string was not in a correct format- URGENT HELP NEEDED

Shyam

3/18/2007 11:22:00 AM

Hi all,

I'm facing this Error in my application once in a while and once the
app.jobs are re-run it might/might not finish successfully. The SP's are upto
date. Any quick solution/ help is very much appreciated.

ERROR:
Input string was not in a correct format.
at System.Text.StringBuilder.FormatError()
at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String
format, Object[] args)
at System.String.Format(IFormatProvider provider, String format, Object[]
args)
at System.String.Format(String format, Object arg0)


2 Answers

Uri Dimant

3/18/2007 12:18:00 PM

0

Shyam

Can you show us what's string you are inserting ? Have you CHECK constraint
defined on the table to format string?




"Shyam" <Shyam@discussions.microsoft.com> wrote in message
news:0C3B8F8A-4172-45AA-9E08-B8A48DCA5E4E@microsoft.com...
> Hi all,
>
> I'm facing this Error in my application once in a while and once the
> app.jobs are re-run it might/might not finish successfully. The SP's are
> upto
> date. Any quick solution/ help is very much appreciated.
>
> ERROR:
> Input string was not in a correct format.
> at System.Text.StringBuilder.FormatError()
> at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String
> format, Object[] args)
> at System.String.Format(IFormatProvider provider, String format, Object[]
> args)
> at System.String.Format(String format, Object arg0)
>
>


Dan Guzman

3/18/2007 2:43:00 PM

0

The immediate cause of this error is a is a malformed string passed to the
String.Format method in your code. For example, the following will cause
the error because the token is specified as "{0)" instead of the proper
"{0}":

string errorExample = String.Format("{0)", "my value");

Since you posted this to a SQL forum, I assume you suspect the error is
related to SQL Server. Perhaps the format error is occurring in a catch
block and obfuscating the actual SQL error.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Shyam" <Shyam@discussions.microsoft.com> wrote in message
news:0C3B8F8A-4172-45AA-9E08-B8A48DCA5E4E@microsoft.com...
> Hi all,
>
> I'm facing this Error in my application once in a while and once the
> app.jobs are re-run it might/might not finish successfully. The SP's are
> upto
> date. Any quick solution/ help is very much appreciated.
>
> ERROR:
> Input string was not in a correct format.
> at System.Text.StringBuilder.FormatError()
> at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String
> format, Object[] args)
> at System.String.Format(IFormatProvider provider, String format, Object[]
> args)
> at System.String.Format(String format, Object arg0)
>
>