TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
patrick
NA
397
0
Insert Binary Array
Jun 25 2009 4:12 PM
Im trying to stick a binary[] into a file using c#.net. br />
public static void serializeAndStoreData(Data D){ ADODB.Connection conData = new ADODB.Connection();
string strSQL;
object obj = new object();
Guid g = Guid.NewGuid();
Byte[] B = new byte[10];
B=ObjectByteArrayConverter.ObjectToByteArray(D);
conData.Open
("Provider=Microsoft.Jet.OLEDB.4.0;"+ "Data Source=" +Properties.Settings.Default.networkedConString, "", "", 0);
strSQL = "INSERT INTO Test (ID, Data) VALUES('" + g + "', '" + B + "' );";
conData.Execute(strSQL, out obj, 0);
conData.Close();
}
I know the serialize works. for some reason, when i pull out data and cast it to byte[], it isnt right. For example, a byte[2000] goes into the database and comes out as byte[30].
Reply
Answers (
1
)
new error in c# code plz help
How to Develop a Chat Server within an existing application