populating a combobox with data from a database

visual basic.net , microsoft access 2003 , .net platform Ghana
  • 12 years ago
    I have written the following code and it keeps on giving me this error please help. The code is below: upgradedconnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source =C:\Documents and Settings\Theodora-nss08025\My Documents\Visual Studio 2005\Projects\uploaded\uploaded\My Project\upgraded.mdb") upgradedcommand = New OleDbCommand("SELECT grade from staffgrade", upgradedconnection) upgradedadapter = New OleDbDataAdapter() upgradedadapter.SelectCommand = upgradedcommand upgradedconnection.Open() Dim dsAuthors As DataSet = New DataSet() upgradedadapter.TableMappings.Add("grade", "staffgrade") upgradedadapter.Fill(dsAuthors) Dim dviewmanager = dsAuthors.DefaultViewManager cbograde.DataSource = dviewmanager cbograde.DisplayMember = "staffgrade.grade" this is the error message I'm getting :: System.Data.DataViewManagerListItemTypeDescriptor thanx in advance for helping.............
  • 12 years ago
    Hi, - after defining datasouce for cbograde, just define DataTextField and DataValueField property of combobox(dropdownlist). and Bind the data. - Do you have any specific reason for using DefaultViewManager? Regards, Royal

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook