منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : String or binary data would be truncated. The statement has been terminated.
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
احاول احفظ صور متعددة الى قاعدة بيانات sql server بعد تحويلها الى binary لكن اتفاجا بظهور رسالة الخطا:
String or binary data would be truncated.
The statement has been terminated.
مع انه تم حفظ ثلاث صور فقط من المجلد ..الكود هو :
كود :
For Each fl In IO.Directory.GetFiles(fbd.SelectedPath & "\")
            If IO.Path.GetExtension(IO.Path.GetFileName(fl)) = ".jpg" = True Or IO.Path.GetExtension(IO.Path.GetFileName(fl)) = ".gif" Or IO.Path.GetExtension(IO.Path.GetFileName(fl)) = ".png" Or IO.Path.GetExtension(IO.Path.GetFileName(fl)) = ".jpeg" Or IO.Path.GetExtension(IO.Path.GetFileName(fl)) = ".JPG" Then
                'MsgBox(IO.Path.GetExtension(IO.Path.GetFileName(fl)))
                ' MsgBox("jpg")
                Dim p() As Byte = My.Computer.FileSystem.ReadAllBytes(IO.Path.GetFullPath(fl))
                Dim cm As New SqlCommand("insert into pic (picname,picbyte) values (@picname,@picbyte)", con)












                cm.Parameters.AddWithValue("@picname", SqlDbType.VarChar).Value = IO.Path.GetFileName(fl)








                cm.Parameters.AddWithValue("@picbyte", p)
























                cm.ExecuteNonQuery()
                ProgressBar1.Value += 1
                ll.Text = ProgressBar1.Value




            End If
        Next
ارجو المساعدة لحل هذا الاشكال فقد بحثت بقوقل بالعربي والانجليزي وكل ما وجدته لم يحل.
عرفت المشكلة وهي ابسط مما كنت اتصور وهي ان عمود اسم الملف حجمة اقل من اسم بعض ملفات الصور