ExecuteScalar limitation

I came across one issue recently. I worked on a windows services in 2005 which ran successfuly .Recently a issue came that < is unexpected token = is expected token. I will explain more in detail. We are using stored procedures to store data in tables. we are loading xml file in to different tables.using stored procedures . While updating xml file with the data from database
this error came. stored procedure returns data in xml format. i checked stored procedure it is working fine. then I surprised where went wrong. I debugged the applcation the string which contains return value of stored procedure is not having complete tags ie end tag is missing and some atttibutes are missing. Then i thought it is some thing with ExecuteScalar function of .net. Then i researched for the ExecuteScalar function in msdn. In MSDN it is clearly written ExecuteReader/ExecuteScalar function will have limitation that the function can written 2033 characters only in a single row. if a command executed by these functions returns more characters then then they will be in multiple rows. In my scenario the xmldata is being truncated 2033 characters hence i am recieving the error. the work around for it use ExecuteXmlreader function we can have as many characters in the returned value
Here is suppot link by the msdn
http://support.microsoft.com/default.aspx?scid=kb;en-us;q310378&id=kb;en-us;q310378&ln=en-us&rnk=1&sd=msdn&fr=0&qry=q310378&src=dhcs_mspss_msdn_srch&spr=msall
happy programming

Comments

Andres said…
Thanks...

Popular Posts