Linq to SQL и VB.NET изображение дисплея
привет
i.m использовал этот код для отображения из БД
....................
Private bs1 As BindingSource, bs2 As BindingSource, bs3 As BindingSource Private Sub frmconve_Load(sender As Object, e As EventArgs) Handles Me.Load Try Dim data = From d In DBVariable.Data.masterfatoras Select d bs1 = New BindingSource() bs2 = New BindingSource() bs3 = New BindingSource() bs1.DataSource = data bs2.DataSource = bs1 bs3.DataSource = bs1 bs2.DataMember = "fatoras" bs3.DataMember = "rasmasgs" gv1.DataSource = bs1 gv2.DataSource = bs2 gv3.DataSource = bs3 ''........................................حقول واسماءها فى الداتا للجريد فيو 'gv1.AutoGenerateColumns = False 'gv2.AutoGenerateColumns = False 'gv3.AutoGenerateColumns = False gv1.DataSource = bs1 gv1.Columns(0).DataPropertyName = "num" gv1.Columns(1).DataPropertyName = "yearnum" gv1.Columns(2).DataPropertyName = "name" gv1.Columns(3).DataPropertyName = "adrs" gv1.Columns(4).DataPropertyName = "noot" gv1.Columns(5).DataPropertyName = "dat1" gv1.Columns(6).DataPropertyName = "dat2" gv1.Columns(7).DataPropertyName = "nomasgon" gv1.Columns(8).DataPropertyName = "nohabs" gv1.Columns(9).DataPropertyName = "day" gv1.Columns(10).DataPropertyName = "month" gv1.Columns(11).DataPropertyName = "yearr" gv1.Columns(12).DataPropertyName = "tothokm" gv1.Columns(13).DataPropertyName = "farq" gv1.Columns(14).DataPropertyName = "image" gv1.Columns(15).DataPropertyName = "morfq" ''........................................................... 'gv2.DataSource = bs2 'gv2.ColumnCount = 7 'gv2.Columns(0).HeaderText = "رقم القضيه" 'gv2.Columns(1).HeaderText = "اسم المخزن" 'gv2.Columns(2).HeaderText = "اسم المسئول" 'gv2.Columns(3).HeaderText = "وصف المخزن" 'gv2.Columns(4).HeaderText = "عنوان المخزن" 'gv2.Columns(5).HeaderText = "تليفون المخزن" 'gv2.Columns(6).HeaderText = "نشط" gv2.Columns(0).DataPropertyName = "numqqd" gv2.Columns(1).DataPropertyName = "no3qad" gv2.Columns(2).DataPropertyName = "tohma" gv2.Columns(3).DataPropertyName = "dayy" gv2.Columns(4).DataPropertyName = "monthh" gv2.Columns(5).DataPropertyName = "year" gv2.Columns(6).DataPropertyName = "dat2" gv2.Columns(7).DataPropertyName = "mid" ''............................................ 'gv3.DataSource = bs3 gv3.Columns(0).DataPropertyName = "datekhter" gv3.Columns(1).DataPropertyName = "date3tmad" gv3.Columns(2).DataPropertyName = "dattr7el" gv3.Columns(3).DataPropertyName = "idnamsegn" gv3.Columns(4).DataPropertyName = "taslem" gv3.Columns(5).DataPropertyName = "datglsa" gv3.Columns(6).DataPropertyName = "sabel" gv3.Columns(7).DataPropertyName = "moot" gv3.Columns(8).DataPropertyName = "idmant" Catch ex As Exception MessageBox.Show(ex.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub
Что я уже пробовал:
Private bs1 As BindingSource, bs2 As BindingSource, bs3 As BindingSource Private Sub frmconve_Load(sender As Object, e As EventArgs) Handles Me.Load Try Dim data = From d In DBVariable.Data.masterfatoras Select d bs1 = New BindingSource() bs2 = New BindingSource() bs3 = New BindingSource() bs1.DataSource = data bs2.DataSource = bs1 bs3.DataSource = bs1 bs2.DataMember = "fatoras" bs3.DataMember = "rasmasgs" gv1.DataSource = bs1 gv2.DataSource = bs2 gv3.DataSource = bs3 ''........................................حقول واسماءها فى الداتا للجريد فيو 'gv1.AutoGenerateColumns = False 'gv2.AutoGenerateColumns = False 'gv3.AutoGenerateColumns = False gv1.DataSource = bs1 gv1.Columns(0).DataPropertyName = "num" gv1.Columns(1).DataPropertyName = "yearnum" gv1.Columns(2).DataPropertyName = "name" gv1.Columns(3).DataPropertyName = "adrs" gv1.Columns(4).DataPropertyName = "noot" gv1.Columns(5).DataPropertyName = "dat1" gv1.Columns(6).DataPropertyName = "dat2" gv1.Columns(7).DataPropertyName = "nomasgon" gv1.Columns(8).DataPropertyName = "nohabs" gv1.Columns(9).DataPropertyName = "day" gv1.Columns(10).DataPropertyName = "month" gv1.Columns(11).DataPropertyName = "yearr" gv1.Columns(12).DataPropertyName = "tothokm" gv1.Columns(13).DataPropertyName = "farq" gv1.Columns(14).DataPropertyName = "image" gv1.Columns(15).DataPropertyName = "morfq" ''........................................................... 'gv2.DataSource = bs2 'gv2.ColumnCount = 7 'gv2.Columns(0).HeaderText = "رقم القضيه" 'gv2.Columns(1).HeaderText = "اسم المخزن" 'gv2.Columns(2).HeaderText = "اسم المسئول" 'gv2.Columns(3).HeaderText = "وصف المخزن" 'gv2.Columns(4).HeaderText = "عنوان المخزن" 'gv2.Columns(5).HeaderText = "تليفون المخزن" 'gv2.Columns(6).HeaderText = "نشط" gv2.Columns(0).DataPropertyName = "numqqd" gv2.Columns(1).DataPropertyName = "no3qad" gv2.Columns(2).DataPropertyName = "tohma" gv2.Columns(3).DataPropertyName = "dayy" gv2.Columns(4).DataPropertyName = "monthh" gv2.Columns(5).DataPropertyName = "year" gv2.Columns(6).DataPropertyName = "dat2" gv2.Columns(7).DataPropertyName = "mid" ''............................................ 'gv3.DataSource = bs3 gv3.Columns(0).DataPropertyName = "datekhter" gv3.Columns(1).DataPropertyName = "date3tmad" gv3.Columns(2).DataPropertyName = "dattr7el" gv3.Columns(3).DataPropertyName = "idnamsegn" gv3.Columns(4).DataPropertyName = "taslem" gv3.Columns(5).DataPropertyName = "datglsa" gv3.Columns(6).DataPropertyName = "sabel" gv3.Columns(7).DataPropertyName = "moot" gv3.Columns(8).DataPropertyName = "idmant" Catch ex As Exception MessageBox.Show(ex.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub