PDA

View Full Version : سوال: ذخیره عکس در اس کیو ال با معماری سه لایه



pesare
یک شنبه 09 تیر 1392, 14:44 عصر
سلام دوستان

من میخوام عکس رو با معماری سه لایه در اس کیو ال ذخیره کنم , برای این کار یه کلاس دارم که داخل اون متدی هست به نام SavePic ,قبل از متد دو تا متغیر دارم که اونها با مقادیر داخل فرم پر میشه و فرستاده میشه برای متد
متغیرداخل کلاس :


publicstring AF;
publicbyte[] arrPic;


متغیر از داخل فرم به این صورت پر میشن :


MemoryStream ms = newMemoryStream();
byte[] arrPic = null;
pictureBox1.Image.Save(ms, pictureBox1.Image.RawFormat);
arrPic = ms.GetBuffer();
ms.Close();
ApFroshi a = new ApFroshi();
a.arrPic = arrPic;
a.AF = txtID.Text;
a.SavePic();


حالا این مقادیری که پرشده فرستاده میشه به متد ذخیره :



publicvoid SavePic()
{
string sql = "Insert Into tblPic (Pic,AF_FK) Values ({0},{1})";
sql = string.Format(sql,this.arrPic,this.AF);
da.Connect();
da.DoCommand(sql);
da.Disconnect();
}


وقتی که اجرا میگیرم این خطا رو میده :

an object or column name is missing or empity . for select into statement verify each column has a name .for other statements ,look for empity elias names.Aliases define az " " or [] are not allowed.change the alias to valid name.incorrect syntax near ''.


این خطا برای چیه؟چطوری برطرف میشه؟

esafb52
یک شنبه 09 تیر 1392, 15:26 عصر
میگه اسم یک شی یا ستون رو نمیتونه پیدا کنه

pesare
یک شنبه 09 تیر 1392, 15:32 عصر
این که از ترجمه اینگلیسیش معلومه ,راه حل چیه؟

pesare
یک شنبه 09 تیر 1392, 18:59 عصر
کسی نیست کمک کنه؟

pesare
دوشنبه 10 تیر 1392, 09:37 صبح
واقعا کسی نیست جواب بده؟