الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

مشكلة في ظهور بيانات جدولين مرتبطين واحد بيانات والاخر صور

بدأه marwan20030 في 25 فبراير 2012 · 0 رد · 475 مشاهدة · في ADO.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1

السلام عليكم

قمت بتصميم برنامجي والحمد لله شبه مكتمل ولكن باقي خاصية البحث فقط.

عندي في قاعدة البيانات عدة جداول وكلها مرتبطة بجدول رئيسي واللذي هو Cars وقمت بانشاء كود البحث والكود شغال ولكن المشكله ان الكود يعمل على جدول Cars فقط.

رمز برمجي:

#Region "اوامر الفلتره"

    Private Sub txtSearch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSearch.TextChanged

        If ComboBox1.SelectedItem = "أسم السيارة" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("carname Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "نوع السيارة" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("cartype Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "موديل السيارة" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("caryear Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "رقم القاعدة" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("carvin Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "الضرر الاولي" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("primarydamage Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "الضرر الثانوي" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("secondarydamage Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "المسافة المقطوعه" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("odometer Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "نوع الوقود" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("fueltype Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "عدد الاسطوانات" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("cylinders Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "قوة المحرك" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("engine Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "ناقل الحركه" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("transmission Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "نوع الدفع" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("drivelinetype Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "الشكل الخارجي" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("bodtstyle Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "اللون الخارجي" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("exteriorcolor Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "اللون الداخلي" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("interiorcolor Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "عدد الارباجات" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("airbags Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "طاوات كروم" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("chromewheels Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "فتحة سقف" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("Sunroof Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "مقاعد جلد" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("leatherseats Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If
        ElseIf ComboBox1.SelectedItem = "جناح خلفي" Then
            If txtSearch.TextLength > 0 Then
                CarsBindingSource.Filter = String.Format("rearwing Like '" & txtSearch.Text) & "*'"
            Else
                CarsBindingSource.Filter = String.Empty
            End If

        End If
    End Sub
#End Region

المشكلة هي عند القيام بالبحث عن السيارة بحسب رقم القاعدة/الشاصية في شاشة طباعه فاتورة بيع/اجل تظهر لي بيانات مواصفات السيارة فقط الموجودة في جدول Cars ولكن لا تظهر لي صور السيارة الموجودة في جدول Carimages بالرغم من عمل علاقة بينهم وكذلك بعض البيانات الاخر المنفصلة في جداول اخرى.

اللذي اريدة هو بعد القيام بالبحث عن السيارة وظهور البيانات اريد ان تظهر صور السيارة.

ارجوا المساعدة

تم تعديل هذه المشاركة بواسطة marwan20030 في 25 فبراير 2012 في 23:04

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…