I have a combobox on my form that I want to populate from a datatable. I have set up a table, and a dataset and a table adapter. To load the table with data (about 50 records) I put the data in an array and looped through it, calling the tableadapter's insert method each time. However, it is not inserting anything into the table.
Here is my code:
Dim genray() As String = {"Action and Adventure", "Chick Lit", "Children's", "Commercial Fiction", "Contemporary", "Crime", "Erotica", "Family", "Fantasy", "Dark Fantasy", "General Fiction", "Graphic Novel", "Historical Fiction", "Horror", "Humour", "Literary Fiction", "Military and Espionage", "Multicultural", "Mystery", "Offbeat or Quirky", "Picture Book", "Religious and Inspirational", "Romance", "Science Fiction", "Short Story Collections", "Thrillers and Suspense", "Western", "Women's Fiction", "Young Adult", "Art & Photography", "Biography & Memoirs", "Business & Finance", "Celebrity & Pop Culture", "Music, Film & Entertainment", "Cookbooks", "Cultural/Social Issues", "Current Affairs & Politics", "Food & Lifestyle", "Gardening", "Gay & Lesbian", "General Non-Fiction", "History & Military ", "Home Decorating & Design", "How To", "Humour & Gift Books", "Journalism", "Juvenile", "Health & Fitness", "Multicultural", "Narrative", "Nature & Ecology", "Parenting", "Pets", "Psychology", "Reference", "Relationship & Dating", "Religion & Spirituality", "Science & Technology", "Self Help", "Sports", "Travel", "True Adventure & True Crime"}
For x = 0 To genray.Length
Me.GenreListTableAdapter.Insert(genray(x))
Next
I got the basic example right from MSDN.
What is wrong?
Here is my code:
Dim genray() As String = {"Action and Adventure", "Chick Lit", "Children's", "Commercial Fiction", "Contemporary", "Crime", "Erotica", "Family", "Fantasy", "Dark Fantasy", "General Fiction", "Graphic Novel", "Historical Fiction", "Horror", "Humour", "Literary Fiction", "Military and Espionage", "Multicultural", "Mystery", "Offbeat or Quirky", "Picture Book", "Religious and Inspirational", "Romance", "Science Fiction", "Short Story Collections", "Thrillers and Suspense", "Western", "Women's Fiction", "Young Adult", "Art & Photography", "Biography & Memoirs", "Business & Finance", "Celebrity & Pop Culture", "Music, Film & Entertainment", "Cookbooks", "Cultural/Social Issues", "Current Affairs & Politics", "Food & Lifestyle", "Gardening", "Gay & Lesbian", "General Non-Fiction", "History & Military ", "Home Decorating & Design", "How To", "Humour & Gift Books", "Journalism", "Juvenile", "Health & Fitness", "Multicultural", "Narrative", "Nature & Ecology", "Parenting", "Pets", "Psychology", "Reference", "Relationship & Dating", "Religion & Spirituality", "Science & Technology", "Self Help", "Sports", "Travel", "True Adventure & True Crime"}
For x = 0 To genray.Length
Me.GenreListTableAdapter.Insert(genray(x))
Next
I got the basic example right from MSDN.
What is wrong?