asp.net を使用して SQL データベースからバイナリ データを取得したいのですが、出力に表示されるデータが挿入したデータと一致しません。これは私のコードです:
string EQuery = "SELECT * FROM Ph_Tbl_Contacts WHERE (Contact_ID =" + Contact_ID + ")";
DataSet DSs = new DataSet();
DataTable dt = new DataTable();
DataRow dr = dt.NewRow();
DSs = DB.ExecuteQueryData(EQuery);
dt = DSs.Tables[0];
// dr = dt.NewRow();
dr = dt.Rows[0];
byte[] pic;
byte[] raw = (byte[])dr["Contact_CardImage"];
// Session[OpenDialog.STORED_IMAGE] = raw ;
これは挿入部分です:
byte[] IMAGEbYTE ;
IMAGEbYTE = (byte[])(Session["SessionImage"]);
string Query = "INSERT INTO Ph_Tbl_Contacts (Contact_Name, Contact_LName, " +
"Contact_Company, Contact_Email, Contact_Tel, " +
"Contact_Mobile,Contact_CardImage,Is_Public,User_ID,Save_Date)" +
"VALUES (N'" + Txt_Name.Text + "', N'" + Txt_LastName.Text + "', N'" +
Txt_CompanyName.Text + "', N'" + Txt_Mail.Text + "', N'" +
Txt_Telephone.Text + "', N'" + Txt_Mobile.Text + "','" +
IMAGEbYTE + "','" + CheckValue + "'," +
Session["User_ID"] + ", N'" + DateStr + "')";
DB.ExecuteQueryNoData(Query) ;