Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27569

VS 2010 Child list cannot be created.

$
0
0
Hi,

Does anyone know why I keep getting this error?

Code:

Private Sub ComboBox1_SelectionChangeCommitted(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectionChangeCommitted
        Try

            'Display recipe details when a meal is selected from the list

            'get its index value
            Dim IntNum As Integer = ComboBox1.SelectedValue
            Dim dsRecipe As New DataSet

            'find it in the database and get the receipe
            Dim sql As String = "SELECT Recipes.RecipeNumber, Recipes.Time, Recipes.Method, Recipes.Serves FROM Recipes WHERE Recipes.RecipeNumber=" & IntNum & ";"

            ConnectToDataBase()
            Dim tablAdaptor As New OleDb.OleDbDataAdapter(sql, dbConnection)

            'store the recipe
            tablAdaptor.Fill(dsRecipe, "RecipeText")

            'display the recipe on screen

            RecipeTitle1.DataBindings.Add("Text", dsRecipe, "Recipes.RecipeName")

            Dim RecipeText As String = "Time" & vbCrLf & dsRecipe.Tables("Recipes").Rows(0).Item(1) _
                                      & vbCrLf & vbCrLf & "Method:" & vbCrLf & dsRecipe.Tables("Recipes").Rows(0).Item(2) _
                                      & vbCrLf & vbCrLf & "Serves:" & vbCrLf & dsRecipe.Tables("Recipes").Rows(0).Item(3)

            RecipeTextBox.Text = RecipeText

        Catch ex As Exception
            MsgBox(Err.Description)
        End Try

    End Sub

Thanks in advance

Viewing all articles
Browse latest Browse all 27569

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>