newb question about strings

  • Thread starter Thread starter Blue Man
  • Start date Start date
B

Blue Man

hello
I am writing an error handling within different classes in asp.net. the
error class reports the Exception E's string to the database.
but it cuts big strings, if i just display the error it is ok , but when i
send it to function to store it in database just a little part of error
string appears.
is that because of size of string?cuz when i change the error message by
hand and put some shorter strings it works fine. i just declared normal
strings like :

string errormessage = null ;
and for catching error :
catch(Exception error)

{

string temp = error.ToString();

ErrorReport myrep = new
ErrorReport(connectionstring,"92",temp,DateTime.Now);

myrep.InserError(); // here in database it's just a little text like
"System.ArgumentE" this short!

Response.Write(temp); // here it apears correctly


}


thanks in advance
 
Blue Man said:
[Strings truncated when written to database]
ErrorReport myrep = new
ErrorReport(connectionstring,"92",temp,DateTime.Now);

myrep.InserError(); // here in database it's just a little
text like "System.ArgumentE" this short!

Response.Write(temp); // here it apears correctly

It sounds as though the database field was declared to be shorter than the
string you're writing into it. What data type and length are you using for
it?

P.
 
Hi Blue man,

I would believe that it's a DB problem, it can be on the table definition,
check the type of the column in the table, it may be a varchar( SIZE ) where
size is not big enough,

Pd:
If you are using SPs check them too!!!

Cheers,
 
Back
Top