garyheffern Posted May 25, 2005 Posted May 25, 2005 I'm having problems filling a dataset that I created using the XML Designer and then dragging a dataset object from the toolbox on to the form. Here's the code: Here's the call from my form: Dim dsOrderItems As dsOrderItems dsOrderItems = SOESdb.GetOrderItems(m_intOrderNumber) Heres the function in the DB class: Public Shared Function GetOrderItems(ByVal OrderNumber As Integer) Dim dsOrderItems As New dsOrderItems Dim cmdOrderItems As New SqlCommand Dim daOrderItems As New SqlDataAdapter cmdOrderItems.Connection = SOESConnection.GetSOESConnection cmdOrderItems.CommandText = "spGetOrderItems" cmdOrderItems.CommandType = StoredProcedure cmdOrderItems.Parameters.Add(New SqlParameter("@OrderID", SqlDbType.Int, 4)).Value = OrderNumber daOrderItems.SelectCommand = cmdOrderItems daOrderItems.Fill(dsOrderItems, "spGetOrderItems") Return dsOrderItems End Function Can you please tell me what change is needed to the function or call. Thank you so much! I've been working on this for two days and I'm starting to panic!!! Gary Quote
Machaira Posted May 26, 2005 Posted May 26, 2005 One thing - don't name your object instances the same as the class name. Ex: Dim dsOrderItems As New dsOrderItems change it to something like: Dim ds As New dsOrderItems Quote Here's what I'm up to.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.