Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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

Here's what I'm up to.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...