473,382 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

newb question about strings

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.No w);

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
Nov 15 '05 #1
3 1177
"Blue Man" <bl**********@nospam.com> wrote:
[Strings truncated when written to database] ErrorReport myrep = new
ErrorReport(connectionstring,"92",temp,DateTime.No w);

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.

--
www.CL4.org
Nov 15 '05 #2
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,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Blue Man" <bl**********@nospam.com> wrote in message
news:eM*************@TK2MSFTNGP11.phx.gbl...
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.No w);

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

Nov 15 '05 #3
you were both right :)
the problem was database type.
thanks
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:%2****************@TK2MSFTNGP10.phx.gbl...
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,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Blue Man" <bl**********@nospam.com> wrote in message
news:eM*************@TK2MSFTNGP11.phx.gbl...
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.No w);

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


Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Travis Ray | last post by:
Hi, I just started a java class and I have this assignment and I'm stumped... I realize the code is messy... but I just started... so go easy on me :) Java Problem I am working on this...
24
by: Apotheosis | last post by:
The problem professor gave us is: Write a program which reads two integer values. If the first is less than the second, print the message "up". If the second is less than the first, print the...
14
by: manstey | last post by:
Hi, Is there a clever way to see if two strings of the same length vary by only one character, and what the character is in both strings. E.g. str1=yaqtil str2=yaqtel they differ at str1...
15
by: manstey | last post by:
Hi, I have a text file called a.txt: # comments I read it using this:
3
by: kevinwolfe | last post by:
Hi all. I'd like any suggestions on how I can get my data set (not a DataSet) bound to a couple of controls on a form. Let me start by describing what my data looks like. Each entry correlates...
6
by: johnny | last post by:
How do I join two string variables? I want to do: download_dir + filename. download_dir=r'c:/download/' filename =r'log.txt' I want to get something like this: c:/download/log.txt
5
by: Andrew Sackville-West | last post by:
Hi list, I've tried, lots of interpreter testing and google grepping to figure this out and I think I'm missing something fundamental. I have an ascii data dump from a POS system that has 131...
3
joppe
by: joppe | last post by:
Hi! This is probably a stupid question, but I've searched and tried to find the answear for 4 hours now and im getting a little tired. Okay here it goes. I got a list containing a char *data...
3
by: code_berzerker | last post by:
Hi i'm relatively new to Python and my C/C++ knowledge is near to None. Having said that I feel justified to ask stupid questions :) Ok now more seriously. I have question refering to char* used...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.