ورود

View Full Version : فیلد blob



maisam57
شنبه 17 فروردین 1387, 14:10 عصر
سلام کد زیر رو توی #C نوشتم ولی متاسفانه مدام error زیر رو میده هر چی اسم متغیر رو عوض میکنم هیچ تغییری نمیکنه


string filestr = openFileDialog1.FileName;
FileStream fs = new FileStream(filestr, FileMode.Open);
FileInfo fi = new FileInfo(filestr);
byte[] f = new byte[(int)fi.Length];
fs.Read(f, 0, (int)fi.Length);
OracleConnection cn2 = new OracleConnection(@"Data Source=gs;Persist Security Info=True;User ID=sa;Password=key2231871;Unicode=True");
cn2.Open();
OracleCommand command2 = new OracleCommand();
command2.Connection = cn2;
command2.CommandText = "INSERT INTO TEST(MYFILE) VALUES(@MYFILE)";
command2.Parameters.Add("@MYFILE", OracleType.Blob).Value=f;
command2.ExecuteNonQuery();
cn2.Close();

پیغام خطا
ORA-01036: illegal variable name/number

maisam57
شنبه 17 فروردین 1387, 15:53 عصر
دوستان من همین کد رو برای sqlserver2000 و access نوشتم بدون هیچ مشکلی فایل توی بانک ذخیره شد و توی اراکل error داد البته ابنم بگم که توی یه pdf مربوط به خطاهای اراکل این پیغام رو دیدم ولی چیزی متوجه نشدم
ORA-01036 illegal variable name/number
Cause: Unable to find bind context on user side
Action: Make sure that the variable being bound is in the SQL statement

aidin300
شنبه 17 فروردین 1387, 17:59 عصر
به جای @ از : استفاده کن و این لینکم ببین فراخوانی یک StoredProcedure که پارامترمی گیرد (http://barnamenevis.org/forum/showthread.php?t=78580)