CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.commerce_starter_kit Tags:
Item Type: NewsGroup Date Entered: 6/27/2005 6:32:10 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 35 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
wabs27
Asp.Net User
myCommand.Fill(myDataSet, "OrderItems")6/27/2005 6:32:10 PM

0/0

I am trying to update the OrderDetails.aspx file to display more additional order information including Billing Address, Shipping Address, Tracking Number, etc.

I have created new parameters and am having the values outputted to them via the OrdersDetail stored procedure.  I have also updated the OrderDB.vb class accordingly.  Everything seems to be moving smoothly except that the 'items ordered' list is not appearing. 

This is the code I have in OrderDetails.aspx to display the grid:
' Bind Items to GridControl
GridControl1.DataSource = myOrderDetails.OrderItems
GridControl1.DataBind()


My Stored Procedure is as follows:

CREATE Procedure dbo.CMRC_OrdersDetail
(
    @OrderID    int,
    @CustomerID int,
    @OrderDate  datetime OUTPUT,
    @OrderTotal money OUTPUT,
    @ShipFirstName    nvarchar(30) OUTPUT,
    @ShipLastName     nvarchar(30) OUTPUT,
    @ShipAddress1     nvarchar(50) OUTPUT,
    @ShipAddress2     nvarchar(50) OUTPUT,
    @ShipCity         nvarchar(30) OUTPUT,
    @ShipState        nvarchar(2) OUTPUT,
    @ShipZip          nvarchar(10) OUTPUT,
    @BillFirstName    nvarchar(30) OUTPUT,
    @BillLastName     nvarchar(30) OUTPUT,
    @BillAddress1     nvarchar(50) OUTPUT,
    @BillAddress2     nvarchar(50) OUTPUT,
    @BillCity         nvarchar(30) OUTPUT,
    @BillState        nvarchar(2) OUTPUT,
    @BillZip          nvarchar(10) OUTPUT,
    @Shipper          nvarchar(10) OUTPUT,
    @TrackingNumber   nvarchar(10) OUTPUT
)

AS

/* Return the order dates from the Orders
    Also verifies the order exists for this customer. */
SELECT
    @OrderDate = OrderDate,
    @Shipper = CMRC_Orders.Shipper,
    @TrackingNumber = CMRC_Orders.Notes,
    @ShipFirstName = toycsk.CMRC_ShippingInfo.ShipFirstName,
    @ShipLastName = toycsk.CMRC_ShippingInfo.ShipLastName,
    @ShipAddress1 = toycsk.CMRC_ShippingInfo.ShipAddress1,
    @ShipAddress2 = toycsk.CMRC_ShippingInfo.ShipAddress2,
    @ShipCity = toycsk.CMRC_ShippingInfo.ShipCity,
    @ShipState = toycsk.CMRC_ShippingInfo.ShipState,
    @ShipZip = toycsk.CMRC_ShippingInfo.ShipZip,
    @BillFirstName = toycsk.CMRC_BillingInfo.BillFirstName,
    @BillLastName = toycsk.CMRC_BillingInfo.BillLastName,
    @BillAddress1 = toycsk.CMRC_BillingInfo.BillAddress1,
    @BillAddress2 = toycsk.CMRC_BillingInfo.BillAddress2,
    @BillCity = toycsk.CMRC_BillingInfo.BillCity,
    @BillState = toycsk.CMRC_BillingInfo.BillState,
    @BillZip = toycsk.CMRC_BillingInfo.BillZip
   
FROM   
    CMRC_Orders

  INNER JOIN toycsk.CMRC_ShippingInfo ON CMRC_Orders.ShipID = toycsk.CMRC_ShippingInfo.ShipID
  INNER JOIN toycsk.CMRC_BillingInfo ON CMRC_Orders.BillID = toycsk.CMRC_BillingInfo.BillID

   
WHERE  
    CMRC_Orders.OrderID = @OrderID
    AND
    CMRC_Orders.CustomerID = @CustomerID

IF @@Rowcount = 1
BEGIN

/* First, return the OrderTotal out param */
SELECT 
    @OrderTotal = Cast(SUM(CMRC_OrderDetails.Quantity * CMRC_OrderDetails.UnitCost) as
money)
   
FROM   
    CMRC_OrderDetails
   
WHERE  
    OrderID= @OrderID


/* Then, return the recordset of info */
SELECT 
    CMRC_Products.ID,
    CMRC_Products.ProductName,
    CMRC_Products.StyleNumber,
    CMRC_OrderDetails.UnitCost,
    CMRC_OrderDetails.Quantity,
    (CMRC_OrderDetails.Quantity * CMRC_OrderDetails.UnitCost) as ExtendedAmount

FROM
    CMRC_OrderDetails
  INNER JOIN CMRC_Products ON CMRC_OrderDetails.ProductID = CMRC_Products.ID
 
WHERE  
    OrderID = @OrderID

END
GO


Is there something wrong with my stored procedure or does anyone know any other reason why I may be running into this problem?

Thanks.

AgileXML
Asp.Net User
Re: myCommand.Fill(myDataSet, "OrderItems")6/27/2005 7:08:23 PM

0/0

I think the core to this question is how you are calling the SQL and populating the Table....I'm not sure where your output parameters are being accessed etc....however, that being said, I'm going to suggest an alternative:

I suggest you look at utilizing SQLXML to return XML from SQL Server.  It's obvious that you're dealing with hierarchical data here and that is XML's main job.  When you get your XML back from SQL Server, I would then suggest de-serializing it into a custom object that you make that has all the single parameters (OrderDate, PONumber etc) and an array of line items.  When you deserialize the output and have a single instance of this order object, you can then bind your datagrid to order.lineitems (this is an IEnumerable array).  I think object databinding is overlooked far too much and the combination of object binding and de/serialization make your ASP.NET code minimal in terms of transferring data between presentation and SQL.  Let me know if you want to go this route and need further help with this.


Jason Dodge
Enterprise Architect

http://www.agilexml.com
wabs27
Asp.Net User
Re: myCommand.Fill(myDataSet, "OrderItems")6/27/2005 8:30:07 PM

0/0

Thanks for the advice.  That is something I will definitely want to try out.  I have not worked hands-on with XML in ASP.NET yet so this sounds like an exciting excercise that I would like to try.

However, I would still like to know why I am running into this problem from my stored procedures.    My output parameters are defined in the OrdersDB.vb class.  I practically just added fields from what was already there. CSK is requesting OrderDate from the Orders table.  I just requested some more info from Orders table and did some joins.  All I am trying to do is add a few fields to what the Commerce Starter Kit is already requesting and displaying on the OrderDetails page.
jakeburkey
Asp.Net User
Re: myCommand.Fill(myDataSet, "OrderItems")6/28/2005 3:27:51 AM

0/0

Jason - that XML stuff sounds cool.  I've been doing similar stuff in JavaScript and would like to try it in .NET, but  I'd need a much more detailed explanation to understand how to do what you've suggested.


wabs27 - the SP looks OK, but there is a simple way to find out for sure, if you have Query Analyzer.  Just copy and paste the SP into the analyzer and click on the check syntax button (green check mark graphic on it).  You'll get a message one way or the other regarding whether the db was actually able to execute the command.

If you don't have Query Analyzer, it comes with the SQL Server developer edition ($49).

jake
wabs27
Asp.Net User
Re: myCommand.Fill(myDataSet, "OrderItems")6/28/2005 3:50:16 PM

0/0

Thanks for your help.  It was actually such a silly mistake.  There was nothing wrong with the SP or my code.  I just had an extra html tag which prevented the datagrid from displaying.
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Invalid attempt to FieldCount when reader is closed - .NET ASP Create and Fill the DataSet Dim myDataSet As New DataSet() myCommand.Fill( myDataSet ... Public OrderItems As DataSet Public OrderID As Integer ...
OrdersDetail error on commerce starter kit code - ASP.NET Forums Line 123: myCommand.Fill(myDataSet, "OrderItems") Line 124: Line 125: ' ship date is null if order doesn't exist, or belongs to a different user ...
進階開發篇:Commerce Starter Kit 可抄的寶在那裡? Add(parameterOrderTotal) '取得資料儲存到DataSet Dim myDataSet As New DataSet() myCommand.Fill(myDataSet, "OrderItems") If Not parameterShipDate. ...
TheMSsForum.com >> Ado >> creating dataset from datarowcollection ... For one user I upload a picture, add a new PictureRow in the myDataSet. .... Close() It stops at MyCommand.Fill(dsi). Any ideas? ...
Untitled SqlDataAdapter myDataAdapter = new SqlDataAdapter(myCommand); .... Fill( myDataSet);. The preceding code will populate the DataSet with two DataTable ...
ng.novell-forums.novell-community-industry-specific-education/4 ... mycommand.fill(mydataset, "orderitems") · phantom compile error · can using asp. net 1.x in vs2005, where? how to create a asp.net web application in visual ...
Can I compile VB6 files using VS 2005? - ng.asp-net-forum ... mycommand.fill(mydataset, "orderitems") · how to disable the automatic redirection mechanism · i need help with the classifieds starter kit ...
Untitled SqlDataAdapter myDataAdapter = new SqlDataAdapter(myCommand); .... Fill( myDataSet);. The preceding code will populate the DataSet with two DataTable ...
ng.novell-forums.novell-community-industry-specific-education/4 ... mycommand.fill(mydataset, "orderitems") · phantom compile error · can using asp. net 1.x in vs2005, where? how to create a asp.net web application in visual ...
Can I compile VB6 files using VS 2005? - ng.asp-net-forum ... mycommand.fill(mydataset, "orderitems") · how to disable the automatic redirection mechanism · i need help with the classifieds starter kit ...




Search This Site:










httpwebrequest gets internalservererror for a particular https address

posting articles

button validation

script error

requirements for installing .net framework on windows 98

master page problem at the time of deployment

can't read registry entry after being deployed onto windows 2003 server

security for document to download

3.0.12 bug: child portals seeing other portal documents

how can i open a webform?

td bgcolor based on variable

using a field from a database

other languages

saving data between pages

datagrid hyperlinkcolumn

follow up on the second atlanta dotnetnuke users meetup

can't see "server objects and events" from drop-down list

question using vbc.exe

trouble understanding relationship between .net smtp and iis smtp

error using asp.net configuration / with starter kits personal web, & club web

module bug?

ssrs webservice: the request failed with http status 401: unauthorized.

com interop and aspcompat and asp.net 2.0

n-tier problem

webmatrix and usercontrols

how to create a role in c# codes?

aspnet_setsql.exe missing

treeview control - prevent root node from expanding/collapsing urgent

child portal create error.

use aspx value in codebehind.

 
All Times Are GMT