Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
0
Reply
GetBytes method for Text, NText, or Image not for nvarchar?
sankeerth R
Dec 13 2017 7:30 AM
233
Reply
The GetBytes function can only be used on columns of type Text, NText, or Image but not for nvarchar datatype.
byte[] outbyte = new byte[dr.GetBytes(dr.Getordinal["Notes"], 0, null, 0, 0)];
long y = dr.GetBytes(dr.Getordinal["Notes"], 0, outbyte, 0, 1000);
encodedtext = Encoding.UTF8.GetString(outbyte);
exception i got is The GetBytes function can only be used on columns of type Text, NText, or Image but not for nvarchar datatype.
Note: Here "Notes" column is a nvarchar type.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
Procedure or function has too Argument Specified
C# code to save datetime format in 01/01/1900 hh:mm:ss