displayin multiple/same datasets in combo box prob[RESOLVED!!FIND OUT OWN MISTAKE :d]
Hello..
im desperately need sumone's help to solve ma combo box prob..
im using sql server 2000 connected to ma vb.net application..
when i open n close n open back a form which contains combo box..
it displays a multiple datasets ..for example..
lets say ma combo box contains n shld display like this...
A01
A02
A03
A04
A05
A06
n if i open a form again then it wil display t list of combo box like this..
A01
A02
A03
A04
A05
A06
A01
A02
A03
A04
A05
A06
plz...sumone guide me urgently/immedietely...as i hv to b dun this proj b4 tis thursday, 29th September 2005
here in i hv attached also ma code..
Public sqlEmp As String = "Select * from [Employee] order by id"
Public sqlMT As String = "Select * from [monthly type]"
Public sqlGr As String = "Select * from [Grade]"
Public sqlPos As String = "Select * from [Position]"
Public sqlEmpStas As String = "Select * from [Employee Status]"
Public sqlEmpType As String = "Select * from [EmploymentType]"
Public sqlBank As String = "Select * from [Bank]"
Public sqlBB As String = "Select * from [Bank Branch]"
Public ds0, ds1, ds2, ds3, ds4, ds5, ds6, ds7, ds8, ds9 As New DataSet
Public dvm0 As DataViewManager = ds1.DefaultViewManager
Public dvm1 As DataViewManager = ds1.DefaultViewManager
Public dvm2 As DataViewManager = ds2.DefaultViewManager
Public dvm3 As DataViewManager = ds3.DefaultViewManager
Public dvm4 As DataViewManager = ds4.DefaultViewManager
Public dvm5 As DataViewManager = ds5.DefaultViewManager
Public dvm6 As DataViewManager = ds6.DefaultViewManager
Public dvm7 As DataViewManager = ds7.DefaultViewManager
Public dvm8 As DataViewManager = ds8.DefaultViewManager
Try
'Open connection
myConn.Open()
Dim da0 As SqlDataAdapter = New SqlDataAdapter(sqlEmp, myConn)
Dim da1 As SqlDataAdapter = New SqlDataAdapter(sqlMT, myConn)
Dim da2 As SqlDataAdapter = New SqlDataAdapter(sqlGr, myConn)
Dim da3 As SqlDataAdapter = New SqlDataAdapter(sqlPos, myConn)
Dim da4 As SqlDataAdapter = New SqlDataAdapter(sqlEmpType, myConn)
Dim da5 As SqlDataAdapter = New SqlDataAdapter(sqlEmpStas, myConn)
Dim da6 As SqlDataAdapter = New SqlDataAdapter(sqlPayStas, myConn)
Dim da7 As SqlDataAdapter = New SqlDataAdapter(sqlBank, myConn)
Dim da8 As SqlDataAdapter = New SqlDataAdapter(sqlBB, myConn)
da0.Fill(ds0, "[Employee]")
cb0.DataSource = dvm0
cb0.DisplayMember = "[Employee].emp_no"
da1.Fill(ds1, "[monthly type]")
cb1.DataSource = dvm1
cb1.DisplayMember = "[monthly type].description"
da2.Fill(ds2, "[Grade]")
cb2.DataSource = dvm2
cb2.DisplayMember = "[Grade].description"
da3.Fill(ds3, "[Position]")
cb3.DataSource = dvm3
cb3.DisplayMember = "[Position].description"
da4.Fill(ds4, "[EmploymentType]")
cb4.DataSource = dvm4
cb4.DisplayMember = "[EmploymentType].description"
da5.Fill(ds5, "[Employee Status]")
cb5.DataSource = dvm5
cb5.DisplayMember = "[Employee Status].description"
da6.Fill(ds6, "[Payroll Status]")
cb6.DataSource = dvm6
cb6.DisplayMember = "[Payroll Status].description"
da7.Fill(ds7, "[Bank]")
cb7.DataSource = dvm7
cb7.DisplayMember = "[Bank].Bank"
da8.Fill(ds8, "[Bank Branch]")
cb8.DataSource = dvm8
cb8.DisplayMember = "[Bank Branch].Branch"
Catch ae As SqlException
MessageBox.Show(ae.Message)
Finally
myConn.Close()
End Try
Hello..
im desperately need sumone's help to solve ma combo box prob..
im using sql server 2000 connected to ma vb.net application..
when i open n close n open back a form which contains combo box..
it displays a multiple datasets ..for example..
lets say ma combo box contains n shld display like this...
A01
A02
A03
A04
A05
A06
n if i open a form again then it wil display t list of combo box like this..
A01
A02
A03
A04
A05
A06
A01
A02
A03
A04
A05
A06
plz...sumone guide me urgently/immedietely...as i hv to b dun this proj b4 tis thursday, 29th September 2005
here in i hv attached also ma code..
Public sqlEmp As String = "Select * from [Employee] order by id"
Public sqlMT As String = "Select * from [monthly type]"
Public sqlGr As String = "Select * from [Grade]"
Public sqlPos As String = "Select * from [Position]"
Public sqlEmpStas As String = "Select * from [Employee Status]"
Public sqlEmpType As String = "Select * from [EmploymentType]"
Public sqlBank As String = "Select * from [Bank]"
Public sqlBB As String = "Select * from [Bank Branch]"
Public ds0, ds1, ds2, ds3, ds4, ds5, ds6, ds7, ds8, ds9 As New DataSet
Public dvm0 As DataViewManager = ds1.DefaultViewManager
Public dvm1 As DataViewManager = ds1.DefaultViewManager
Public dvm2 As DataViewManager = ds2.DefaultViewManager
Public dvm3 As DataViewManager = ds3.DefaultViewManager
Public dvm4 As DataViewManager = ds4.DefaultViewManager
Public dvm5 As DataViewManager = ds5.DefaultViewManager
Public dvm6 As DataViewManager = ds6.DefaultViewManager
Public dvm7 As DataViewManager = ds7.DefaultViewManager
Public dvm8 As DataViewManager = ds8.DefaultViewManager
Try
'Open connection
myConn.Open()
Dim da0 As SqlDataAdapter = New SqlDataAdapter(sqlEmp, myConn)
Dim da1 As SqlDataAdapter = New SqlDataAdapter(sqlMT, myConn)
Dim da2 As SqlDataAdapter = New SqlDataAdapter(sqlGr, myConn)
Dim da3 As SqlDataAdapter = New SqlDataAdapter(sqlPos, myConn)
Dim da4 As SqlDataAdapter = New SqlDataAdapter(sqlEmpType, myConn)
Dim da5 As SqlDataAdapter = New SqlDataAdapter(sqlEmpStas, myConn)
Dim da6 As SqlDataAdapter = New SqlDataAdapter(sqlPayStas, myConn)
Dim da7 As SqlDataAdapter = New SqlDataAdapter(sqlBank, myConn)
Dim da8 As SqlDataAdapter = New SqlDataAdapter(sqlBB, myConn)
da0.Fill(ds0, "[Employee]")
cb0.DataSource = dvm0
cb0.DisplayMember = "[Employee].emp_no"
da1.Fill(ds1, "[monthly type]")
cb1.DataSource = dvm1
cb1.DisplayMember = "[monthly type].description"
da2.Fill(ds2, "[Grade]")
cb2.DataSource = dvm2
cb2.DisplayMember = "[Grade].description"
da3.Fill(ds3, "[Position]")
cb3.DataSource = dvm3
cb3.DisplayMember = "[Position].description"
da4.Fill(ds4, "[EmploymentType]")
cb4.DataSource = dvm4
cb4.DisplayMember = "[EmploymentType].description"
da5.Fill(ds5, "[Employee Status]")
cb5.DataSource = dvm5
cb5.DisplayMember = "[Employee Status].description"
da6.Fill(ds6, "[Payroll Status]")
cb6.DataSource = dvm6
cb6.DisplayMember = "[Payroll Status].description"
da7.Fill(ds7, "[Bank]")
cb7.DataSource = dvm7
cb7.DisplayMember = "[Bank].Bank"
da8.Fill(ds8, "[Bank Branch]")
cb8.DataSource = dvm8
cb8.DisplayMember = "[Bank Branch].Branch"
Catch ae As SqlException
MessageBox.Show(ae.Message)
Finally
myConn.Close()
End Try
Last edited: