Tuesday 6 December 2011

T4 template solves Linq-to-SQL and String or binary data would be truncated error.

Recently we developed a project using Linq-to-SQL, but we encountered an issue when trying to save data. SQL Server returned an error message “String or binary data would be truncated”. The error message simply means the string we try to insert into database is too long. 
We have a few options to fix the issue, but we created a T4 template that would automatically truncate the string if it is too long. Here is the code.

2 comments:

Anonymous said...

generic alesse birth control side effects http://surveys.questionpro.com/a/TakeSurvey?id=3418967 aleve side effects mayo clinic [url=http://www.world66.com/member/alesse_y3pt1ory7d8/] alesse birth control reviews weight gain[/url] alesse pilule generation alesse birth control medical ingredients alesse 21 vs 28
mamoleptino321
alesse birth control emotional side effects http://www.world66.com/member/alesse_qed8g1891hp/ pilule alesse 28 [url=http://www.world66.com/member/alesse_leap56nav6q/] birth control alesse 28[/url] alesse 21 birth control reviews alessi toaster best price alesse vs generic brand

http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.panclassified.com%2Fads%2Fpakistan-muslim-league-n-forum-pmln-mcj16823%2F&layout=button_count&show_faces=false&width=&action=like&colorscheme=light&send=false&height=27&locale=en_US http://www.softchilly.com/ads/www-torysale-webs-com-cheap-ugg-boots-tfs2/#comment-102741 http://www.sowdu.com/full-form-for-various-extensions-formats-to-techies/comment-page-17/#comment-83901 http://aristopr.com/?p=3161&cpage=1#comment-262794 http://yesilhuyuk.com/index.php/k2-showcase/k2-category/politics/item/68-coast-locked-down-as-leaders-reject-vote-results/68-coast-locked-down-as-leaders-reject-vote-results?start=3930+Result:+%F3%F1%EF%E5%F5;

alesso years download hulk http://archive.org/details/saimeneme alesse pastillas [url=http://surveys.questionpro.com/a/TakeSurvey?id=3418722] alberto alessi wikipedia[/url] alesse 21 birth control reviews alesse birth control active ingredients side effects of alesse 28 birth control

Anonymous said...

I was curious if you еver thought of changing the laуout of youг sitе?
Its very well wгitten; I love what youve got to saу.
But maybe you coulԁ a lіttle more іn the way οf content sο peoρle could connect ωith it
bettеr. Youve got an аwful lot оf text fοr onlу having 1 or two images.
Maybe уou could spacе іt out betteг?



Here is my sitе; hcg menu