Subject: ASP.NET E-Commerce Prog Problem - Design -
Posted By: gapoce Post Date: 6/16/2003 5:53:36 AM
I have recently bought this book!

When running  http://localhost/gadgetswarehouse/default.aspx in my browser I’m getting:

"Must declare the variable '@CategoryID'."

Something must be wrong with the way the parameters are passed in the calls. Access to the database seems to be OK - but I'm stumbling when trying to execute the stored procedure!

How do I fix this problem?

Reply By: gapoce Reply Date: 6/16/2003 7:20:37 AM
I have also tried to add a parameter i.e.
http://localhost/gadgetswarehouse/default.aspx?Category="1"

the result is:
Input string was not in a correct format.

How do I fix the problem?
Reply By: gapoce Reply Date: 6/16/2003 7:23:10 AM
Correction to above:
 http://localhost/gadgetswarehouse/default.aspx?CategoryID="1"
Reply By: Hal Levy Reply Date: 6/16/2003 5:36:49 PM
It sounds to me like the problem is with the Stored Procedure.. Check the SP and make sure you spelled the Parameter name correctly.


Hal Levy
Daddyshome, LLC
Reply By: gapoce Reply Date: 6/19/2003 5:44:57 AM
Thanks Hal,

I belive it's something more fundamental than a simple spelling problem!
Please have a look at the following listing:

Server Error in '/gadgetswarehouse' Application.
--------------------------------------------------------------------------------

Must declare the variable '@CategoryID'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Must declare the variable '@CategoryID'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[SqlException: Must declare the variable '@CategoryID'.]
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +643
   System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +9
   System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
   GW.CMPServices.SqlPersistenceContainer.AssignReturnValueToDataSet(CommandMapping cmdMap, SqlCommand currentCmd, PersistableObject& persistObjectSet)
   GW.CMPServices.SqlPersistenceContainer.Select(PersistableObject selectObject)

[Exception: Persistance (Select) Failed for PersistableObject]
   GW.CMPServices.SqlPersistenceContainer.Select(PersistableObject selectObject)
   GW.Web.ProductCatalog.ProductCatalog.GetChildCategories(Int32 categoryId)
   GW.Web.ProductCatalog.ProductCatalog.GetCategories()
   GW.Web.UserControls.TopCategoryDropDown.BindData()
   GW.Web.UserControls.TopCategoryDropDown.Page_Load(Object sender, EventArgs e)
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +29
   System.Web.UI.Control.LoadRecursive() +92
   System.Web.UI.Control.LoadRecursive() +92
   System.Web.UI.Page.ProcessRequestMain() +707

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0
Request Details
Session Id:  Request Type: GET
Time of Request: 6/19/2003 12:26:05 PM Status Code: 500
Request Encoding: Unicode (UTF-8) Response Encoding: Unicode (UTF-8)
Trace Information
Category Message From First(s) From Last(s)
aspx.page Begin Init   
aspx.page End Init 0.009323 0.009323
 Entering SqlPersistenceContainer.Select() [Signature: Void Select(GW.CMPServices.PersistableObject)] 0.020022 0.010699
 Executing Stored Proc: Gw_Select_Categories 0.021128 0.001106
 Command Parameter Added for SQL Persistence: @CategoryId 0.021267 0.000139
 param direction : Input 0.021406 0.000139
 Value Set for Parameter @CategoryId is -1 0.021566 0.000160
 Selecting Plural 0.052487 0.030922
Unhandled Execution Error

Persistance (Select) Failed for PersistableObject
  at GW.CMPServices.SqlPersistenceContainer.Select(PersistableObject selectObject)
  at GW.Web.ProductCatalog.ProductCatalog.GetChildCategories(Int32 categoryId)
  at GW.Web.ProductCatalog.ProductCatalog.GetCategories()
  at GW.Web.UserControls.TopCategoryDropDown.BindData()
  at GW.Web.UserControls.TopCategoryDropDown.Page_Load(Object sender, EventArgs e)
  at System.Web.UI.Control.OnLoad(EventArgs e)
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Page.ProcessRequestMain() 0.070975 0.018488

Control Tree
Control Id Type Render Size Bytes (including children) Viewstate Size Bytes (excluding children)
Headers Collection
Name Value
Connection Keep-Alive
Accept */*
Accept-Encoding gzip, deflate
Accept-Language sv
Host localhost
User-Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)
Server Variables
Name Value
ALL_HTTP HTTP_CONNECTION:Keep-Alive HTTP_ACCEPT:*/* HTTP_ACCEPT_ENCODING:gzip, deflate HTTP_ACCEPT_LANGUAGE:sv HTTP_HOST:localhost HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)  
ALL_RAW Connection: Keep-Alive Accept: */* Accept-Encoding: gzip, deflate Accept-Language: sv Host: localhost User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)  
APPL_MD_PATH /LM/W3SVC/1/Root/gadgetswarehouse
APPL_PHYSICAL_PATH C:\Inetpub\wwwroot\GWSetup\
AUTH_TYPE   
AUTH_USER   
AUTH_PASSWORD   
LOGON_USER   
REMOTE_USER   
CERT_COOKIE   
CERT_FLAGS   
CERT_ISSUER   
CERT_KEYSIZE   
CERT_SECRETKEYSIZE   
CERT_SERIALNUMBER   
CERT_SERVER_ISSUER   
CERT_SERVER_SUBJECT   
CERT_SUBJECT   
CONTENT_LENGTH 0
CONTENT_TYPE   
GATEWAY_INTERFACE CGI/1.1
HTTPS off
HTTPS_KEYSIZE   
HTTPS_SECRETKEYSIZE   
HTTPS_SERVER_ISSUER   
HTTPS_SERVER_SUBJECT   
INSTANCE_ID 1
INSTANCE_META_PATH /LM/W3SVC/1
LOCAL_ADDR 127.0.0.1
PATH_INFO /gadgetswarehouse/default.aspx
PATH_TRANSLATED C:\Inetpub\wwwroot\GWSetup\default.aspx
QUERY_STRING   
REMOTE_ADDR 127.0.0.1
REMOTE_HOST 127.0.0.1
REQUEST_METHOD GET
SCRIPT_NAME /gadgetswarehouse/default.aspx
SERVER_NAME localhost
SERVER_PORT 80
SERVER_PORT_SECURE 0
SERVER_PROTOCOL HTTP/1.1
SERVER_SOFTWARE Microsoft-IIS/5.1
URL /gadgetswarehouse/default.aspx
HTTP_CONNECTION Keep-Alive
HTTP_ACCEPT */*
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_ACCEPT_LANGUAGE sv
HTTP_HOST localhost
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)


Reply By: Hal Levy Reply Date: 6/19/2003 8:51:25 AM
Your trying to persist the data to the database...
quote:

Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0
Request Details
Session Id: Request Type: GET
Time of Request: 6/19/2003 12:26:05 PM Status Code: 500
Request Encoding: Unicode (UTF-8) Response Encoding: Unicode (UTF-8)
Trace Information
Category Message From First(s) From Last(s)
aspx.page Begin Init
aspx.page End Init 0.009323 0.009323
Entering SqlPersistenceContainer.Select() [Signature: Void Select(GW.CMPServices.PersistableObject)] 0.020022 0.010699
Executing Stored Proc: Gw_Select_Categories 0.021128 0.001106
Command Parameter Added for SQL Persistence: @CategoryId 0.021267 0.000139
param direction : Input 0.021406 0.000139
Value Set for Parameter @CategoryId is -1 0.021566 0.000160
Selecting Plural 0.052487 0.030922
Unhandled Execution Error



As you can see here- the Parameter @CategoryID is set. Again, I am wondering about the Stored Procedure that is used to persist the data into the database- Can you paste it here?

Hal Levy
Daddyshome, LLC
NOT a Wiley/Wrox Employee
Reply By: gapoce Reply Date: 6/19/2003 2:56:12 PM
Here is a paste of the procedure:

CREATE PROCEDURE Gw_Select_Categories
@CategoryId int
AS
    IF @CategoryID = -1
        SELECT CategoryId, Description, Notes, ParentCategoryId FROM Categories Order by Description
    ELSE
        SELECT CategoryId, Description, Notes, ParentCategoryId FROM Categories WHERE ParentCategoryId = @CategoryId ORDER BY Description
GO
Reply By: Hal Levy Reply Date: 6/19/2003 7:38:35 PM
Change it to this and let me know what happens:


CREATE PROCEDURE Gw_Select_Categories
@CategoryId int = -1
AS
    IF @CategoryId = -1
        SELECT CategoryId, Description, Notes, ParentCategoryId FROM Categories 
          Order by Description
    ELSE
        SELECT CategoryId, Description, Notes, ParentCategoryId FROM Categories
          WHERE ParentCategoryId = @CategoryId
          ORDER BY Description
GO


Hal Levy
NOT a Wiley/Wrox Employee- Got a job for me?
Reply By: gapoce Reply Date: 6/20/2003 9:25:18 AM
I just made the following change in the Store Procedure 'Gw_Select_Categories':
   
IF @CategoryID = -1  ---->> IF @CategoryId = -1

this solved my problem!


Thanks a million Hal!!!


Reply By: Hal Levy Reply Date: 6/20/2003 3:53:13 PM
No Problem.. I noticed the case problem but I never bothered to test case sensitivity in SQL Server- so I didn't suggest it. Now I know

Hal Levy
NOT a Wiley/Wrox Employee- Got a job for me?
Reply By: gapoce Reply Date: 6/23/2003 3:26:02 AM
About half a half-dozen store procedures have similiar problems!
It's definitely a good idea to go through all the store procedures after installation.
Make sure the store procedures code doesn't contain syntax errors!!!
Would it be possible to ask the book author (or somebody else) to update (improve) the sample code.
Reply By: Hal Levy Reply Date: 6/23/2003 7:52:41 PM
This would only be possible if the book was still owned by Wrox- since it is no longer a title they own, they have no contract with the author of the book.


Hal Levy
NOT a Wiley/Wrox Employee- Got a job for me?
Reply By: gapoce Reply Date: 6/24/2003 3:21:39 AM
My 'next' problem is log in! I haven't had time yet to dig in the code! Does anybody have a off the shelf solution? Would be nice with a shortcut!
Reply By: gapoce Reply Date: 6/25/2003 8:30:48 AM
Login problem is solved. I just changed the authentication mode in the web.config file.
New Problem:
When doing final checkout (pressing 'Complete Order' button) I received the following message:
    Message queuing has not been installed on this computer!

After installing Message Queuing (with only the common subcomponent!?) i restarted  my machine. Now, I receive another message saying:
    Queue is not registered in the DS.

Problem is that I do not have any experience with Message Queuing! I would appreciate a quick hint on how to solve this? If not I have to read all the long help texts on message Queuing. Life is cruel...
(Note: I'm running windows XP Professional on a Laptop machine)

Reply By: Hal Levy Reply Date: 6/25/2003 2:42:51 PM
The error is pretty straight forward in this case.. You need to register the queue in the DS.... DS is "Directory Service-- active directory






Hal Levy
NOT a Wiley/Wrox Employee- Got a job for me?
Reply By: nodoubt223rd Reply Date: 6/25/2003 5:50:30 PM
I'm running into the same problem not very familiar with Queuing
I think I entered the DS properly but when I go to the final checkout
The transaction usage is invalid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Messaging.MessageQueueException: The transaction usage is invalid.

Source Error:


Line 70:             mq.DefaultPropertiesToSend.Recoverable = true;
Line 71:
Line 72:             mq.Send( currentOrder );
Line 73:             mq.Close();
Line 74:
 

Source File: C:\Inetpub\wwwroot\wineshopny\OrdersClient\OrdersClient.cs    Line: 72

Stack Trace:


[MessageQueueException (0x80004005): The transaction usage is invalid.]
   System.Messaging.MessageQueue.SendInternal(Object obj, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType) +417
   System.Messaging.MessageQueue.Send(Object obj) +9
   WS.Web.OrdersClient.OrderClient.SubmitOrder(Order currentOrder) in C:\Inetpub\wwwroot\wineshopny\OrdersClient\OrdersClient.cs:72
   WS.Web.FinalCheckout.btnComplete_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\wineshopny\wineshopny\FinalCheckout.aspx.cs:115
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1247

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

Brett G. Murphy
Reply By: gapoce Reply Date: 6/26/2003 5:15:09 AM
Good News! I finally made it to the ‘Your order has been submitted…’ message! Thanks a lot Hal for your help!

Here is how I did it!

The message ‘Queue is not registered in the DS’ can be ignored. There is no need to install Active Directory or any other LDAP server. Just install Message Queuing (only subcomponent ‘Common’ is needed). Create a new private queue called ‘orders’!
Clean up (delete all records) in the table ‘ShoppingCarts’ ! Log in, buy gadgets and it just works!
Reply By: nodoubt223rd Reply Date: 6/26/2003 8:21:46 AM
You are the man!

Brett G. Murphy
Reply By: Hal Levy Reply Date: 6/26/2003 7:03:42 PM
I'll bet that when you create the orders queue it gets put into the AD.. However since I have not used AD with MQ I can't be sure.

Glad you got it working

Hal Levy
NOT a Wiley/Wrox Employee- Got a job for me?
Reply By: dianastudy3 Reply Date: 6/26/2003 9:36:14 PM
>Login problem is solved. I just changed the authentication mode in >the web.config file.

Would you tell me what do you exactly put code in the web.config file? I have the same problem, but still don't know how to set to authentication mode in the web.config file through its code or any other way.


Here is my problem:

I have a login problem with the MSDE database.

When I mannuelly do, I can only create a new database by Use Window NT Integrated Security.
If I use SQL Server Autherntication, it will show me the error msg "ADO Error: ' Login
falled for user 'sa'. Reason: Not associated with a trusted SQL Server connection'"

Now in the web.config file. I have followed the book used   
<appSettings>
    <add key="ConnectionString" value="Server=Home\NetSDK;User ID=sa; Password=; Initial Catalog=WroxJokeShop" />
  </appSettings>

Certainly it showed me Server Error in '/WroxJokeShop' Application.
--------------------------------------------------------------------------------

Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection.

Source Error:


Line 11:
Line 12:         ' Open the connection
Line 13:         connection.Open()
Line 14:
Line 15:         ' Return a SqlDataReader to the calling function
 

Thanks a lot,

Diana (dianastudy2@yahoo.com)

Diana
Reply By: gapoce Reply Date: 6/27/2003 3:14:16 AM
Hal, you are wrong!!! I haven't installed AD (or any other LDAP) on my laptop!

Diana, When installing SQL server I chose mixed mode! I haven't had time yet to try windows authentication.

Here is a paste from my Web.config:
=== start paste ===
-->
    <authentication mode="Forms">
        <forms name="GadgetsWarehouseAuth" loginUrl="login.aspx" protection="All" path="/" />
    </authentication>
===
<appSettings>
   <add key="ErrorViewUrlPrefix" value="/GadgetsWarehouse/ErrorLog/" />
   <add key="ErrorLogBaseDir" value="C:\inetpub\wwwroot\GadgetsWarehouse\Errors\" />
   <add key="DefaultDataSource" value="user id=gadgetuser; password=gadgetuser; database=GadgetsWarehouse; server=gapoce01;"/>
   <add key="OrderQueue" value=".\private$\Orders"/>
 </appSettings>
=== end paste ===
I have manually added 'gadgetuser' (pwd:'gadgetuser')in SQLServer.

Hope this helps!
Reply By: gapoce Reply Date: 6/27/2003 3:42:21 AM
Diana, I just realized that we might not be working on the same book! The book I'm working on is titled 'ASP.NET E-commerce Programming Problem - Design - Solution' ISBN: 1-86100-803-1
Reply By: kungwen Reply Date: 8/7/2003 3:31:37 PM
I also recently bought this book.  When I try to compile the GadgetsAdmin project, I get the following errors:

C:\Inetpub\wwwroot\GadgetsAdmin\Categories.aspx.cs(13): The type or namespace name 'GW' could not be found (are you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\GadgetsAdmin\Categories.aspx.cs(14): The type or namespace name 'GW' could not be found (are you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\GadgetsAdmin\Categories.aspx.cs(15): The type or namespace name 'GW' could not be found (are you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\GadgetsAdmin\EditProduct.aspx.cs(12): The type or namespace name 'GW' could not be found (are you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\GadgetsAdmin\EditProduct.aspx.cs(13): The type or namespace name 'GW' could not be found (are you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\GadgetsAdmin\EditProduct.aspx.cs(14): The type or namespace name 'GW' could not be found (are you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\GadgetsAdmin\EditProduct.aspx.cs(15): The type or namespace name 'GW' could not be found (are you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\GadgetsAdmin\Global.asax.cs(10): The type or namespace name 'GW' could not be found (are you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\GadgetsAdmin\Global.asax.cs(11): The type or namespace name 'GW' could not be found (are you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\GadgetsAdmin\ProductSkus.aspx.cs(12): The type or namespace name 'GW' could not be found (are you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\GadgetsAdmin\ProductSkus.aspx.cs(13): The type or namespace name 'GW' could not be found (are you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\GadgetsAdmin\ProductSkus.aspx.cs(14): The type or namespace name 'GW' could not be found (are you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\GadgetsAdmin\ProductSkus.aspx.cs(15): The type or namespace name 'GW' could not be found (are you missing a using directive or an assembly reference?)
The referenced component 'GW.CMPServices' could not be found.
The referenced component 'GW.ConfigurationServices' could not be found.
The referenced component 'GW.MonitorServices' could not be found.
The referenced component 'GW.MonitorServices.Logging' could not be found.
The referenced component 'GW.SecurityServices' could not be found.
The referenced component 'GW.Web.ProductCatalog' could not be found.

How do I resolve this?

Also, when I run the complete solution, I get an error in the browser saying 'sa' is not a trusted connection.  How come?

Thanks.
Reply By: gapoce Reply Date: 8/8/2003 12:22:39 PM
Hello Kungwen,
I can send you a screenprint (.jpg file) from my installation that might help you. What is your e-mail address?
Reply By: neurokal Reply Date: 8/14/2003 9:04:12 PM
Hello,

can someone post the url to where I can download the code for this book? (ASP.NET E-Commerce Programming) I've been looking for it on the site and can't find it.

Thanks!

Web Dude (5133)
Reply By: nordestgaard Reply Date: 8/18/2003 2:04:22 AM
neuro... http://support.apress.com/

Reply By: nordestgaard Reply Date: 8/18/2003 2:16:40 AM
Maybe I'm a little stupid, but I can't get rid of the "Queue is not registered in the DS." message on the final checkout page... Can anybody tell me exactly what to do.... PLEASE!

Reply By: gapoce Reply Date: 8/22/2003 4:23:13 AM
Make sure you have defined a private Queu with the name 'Orders'(Start/My Computer/Manage/Services and applications/Message Queuing/Private Queus/New...).
Also check the queu name definition in the 'web.config' file.

Reply By: gapoce Reply Date: 1/6/2004 4:02:04 AM
Small hint: Don't forget to delete all records in the Shoppingcarts dataset! Do it with the Enterprise Manager! Happy New Year 2004!
Reply By: ruimeisoft Reply Date: 3/28/2004 2:06:49 PM
I have downloaded the code of this book.
I can only see many .cs files,but can not find .aspx files.
And I can not setup "gadgetswarehouse\GWSetup\Debug\Setup.Exe",so I do not know it's function.
Who can tell me? Why?

Reply By: leonteoh Reply Date: 8/8/2004 2:54:11 PM
Can someone tell me why I get this message "Message queuing has not been installed on this computer" when run in release mode and everything goes well in debug mode. I'm running XP Pro (No domain).


Leon
Reply By: Rethynson Reply Date: 8/24/2004 6:19:47 PM
2 issues here
the first is how do I install message Queuing?

the second is an issue with the auth for the admin piece.
I created the "GW Admin" group and added users to it, still getting access denied.

Reply By: AKINCI_1453 Reply Date: 12/26/2004 3:39:38 PM
quote:
Originally posted by gapoce

Hal, you are wrong!!! I haven't installed AD (or any other LDAP) on my laptop!

Diana, When installing SQL server I chose mixed mode! I haven't had time yet to try windows authentication.

Here is a paste from my Web.config:
=== start paste ===
-->
    <authentication mode="Forms">
        <forms name="GadgetsWarehouseAuth" loginUrl="login.aspx" protection="All" path="/" />
    </authentication>
===
<appSettings>
   <add key="ErrorViewUrlPrefix" value="/GadgetsWarehouse/ErrorLog/" />
   <add key="ErrorLogBaseDir" value="C:\inetpub\wwwroot\GadgetsWarehouse\Errors\" />
   <add key="DefaultDataSource" value="user id=gadgetuser; password=gadgetuser; database=GadgetsWarehouse; server=gapoce01;"/>
   <add key="OrderQueue" value=".\private$\Orders"/>
 </appSettings>
=== end paste ===
I have manually added 'gadgetuser' (pwd:'gadgetuser')in SQLServer.

Hope this helps!




Reply By: hasanali00 Reply Date: 3/2/2005 10:03:28 AM
I am also facing problems startign the application.
I get the error that I cannot connect to DB (not Trusted user).

In the web.config, I have only changed the server property as "server=localhost"

How can I start the app properly. thanks

Reply By: gapoce Reply Date: 3/16/2005 10:59:39 PM
Wouldn't it be nice if we could run this on other database systems (Oracele, MySql etc)!?
Has anybody rewritten the SqlPersistenceContainer stuff?

Gapoce
Reply By: rwojtowicz Reply Date: 10/2/2005 11:07:39 PM
When running  http://localhost/gadgetswarehouse/default.aspx in my browser I’m getting:


Server Error in '/gadgetswarehouse' Application.
--------------------------------------------------------------------------------

SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.

Source Error:


Line 46:             if (catTable == null )
Line 47:             {
Line 48:                 catTable = ProductCatalog.ProductCatalog.GetCategories();
Line 49:                 Cache["Categories"] = catTable;
Line 50:             }
 

Source File: C:\Inetpub\wwwroot\GWSetup\UserControls\TopCategoryDropDown.ascx.cs    Line: 48

Stack Trace:


[SqlException: SQL Server does not exist or access denied.]
   System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +474
   System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
   System.Data.SqlClient.SqlConnection.Open() +384
   GW.CMPServices.SqlPersistenceContainer.Select(PersistableObject selectObject) in C:\asp.net e-commerec\gadgetswarehouse\gadgetswarehouse\CMPServices\SqlPersistenceContainer.cs:45

[Exception: Persistance (Select) Failed for PersistableObject]
   GW.CMPServices.SqlPersistenceContainer.Select(PersistableObject selectObject) in C:\asp.net e-commerec\gadgetswarehouse\gadgetswarehouse\CMPServices\SqlPersistenceContainer.cs:66
   GW.Web.ProductCatalog.ProductCatalog.GetChildCategories(Int32 categoryId) in C:\asp.net e-commerec\gadgetswarehouse\gadgetswarehouse\ProductCatalog\ProductCatalog.cs:37
   GW.Web.ProductCatalog.ProductCatalog.GetCategories() in C:\asp.net e-commerec\gadgetswarehouse\gadgetswarehouse\ProductCatalog\ProductCatalog.cs:23
   GW.Web.UserControls.TopCategoryDropDown.BindData() in C:\Inetpub\wwwroot\GWSetup\UserControls\TopCategoryDropDown.ascx.cs:48
   GW.Web.UserControls.TopCategoryDropDown.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\GWSetup\UserControls\TopCategoryDropDown.ascx.cs:28
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Control.LoadRecursive() +98
   System.Web.UI.Control.LoadRecursive() +98
   System.Web.UI.Page.ProcessRequestMain() +733

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

Reply By: rwojtowicz Reply Date: 10/2/2005 11:15:39 PM
quote:
Originally posted by gapoce

I have recently bought this book!

When running  http://localhost/gadgetswarehouse/default.aspx in my browser I’m getting:

"Must declare the variable '@CategoryID'."

Something must be wrong with the way the parameters are passed in the calls. Access to the database seems to be OK - but I'm stumbling when trying to execute the stored procedure!

How do I fix this problem?





Reply By: rwojtowicz Reply Date: 10/3/2005 5:14:23 AM
Hi
I have some problem with my program
when running http://localhost/gadgetswarehouse/default.aspx in my browser i'm getting :
Server Error in '/gadgetswarehouse' Application.
--------------------------------------------------------------------------------

SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.

Source Error:


Line 46:             if (catTable == null )
Line 47:             {
Line 48:                 catTable = ProductCatalog.ProductCatalog.GetCategories();
Line 49:                 Cache["Categories"] = catTable;
Line 50:             }
 

Source File: C:\Inetpub\wwwroot\GWSetup\UserControls\TopCategoryDropDown.ascx.cs    Line: 48

Stack Trace:


[SqlException: SQL Server does not exist or access denied.]
   System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +474
   System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
   System.Data.SqlClient.SqlConnection.Open() +384
   GW.CMPServices.SqlPersistenceContainer.Select(PersistableObject selectObject) in C:\asp.net e-commerec\gadgetswarehouse\gadgetswarehouse\CMPServices\SqlPersistenceContainer.cs:45

[Exception: Persistance (Select) Failed for PersistableObject]
   GW.CMPServices.SqlPersistenceContainer.Select(PersistableObject selectObject) in C:\asp.net e-commerec\gadgetswarehouse\gadgetswarehouse\CMPServices\SqlPersistenceContainer.cs:66
   GW.Web.ProductCatalog.ProductCatalog.GetChildCategories(Int32 categoryId) in C:\asp.net e-commerec\gadgetswarehouse\gadgetswarehouse\ProductCatalog\ProductCatalog.cs:37
   GW.Web.ProductCatalog.ProductCatalog.GetCategories() in C:\asp.net e-commerec\gadgetswarehouse\gadgetswarehouse\ProductCatalog\ProductCatalog.cs:23
   GW.Web.UserControls.TopCategoryDropDown.BindData() in C:\Inetpub\wwwroot\GWSetup\UserControls\TopCategoryDropDown.ascx.cs:48
   GW.Web.UserControls.TopCategoryDropDown.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\GWSetup\UserControls\TopCategoryDropDown.ascx.cs:28
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Control.LoadRecursive() +98
   System.Web.UI.Control.LoadRecursive() +98
   System.Web.UI.Page.ProcessRequestMain() +733

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

 Can somebody help me with this problem

Thanks
Ryszardw

Reply By: rwojtowicz Reply Date: 10/3/2005 5:16:54 AM
Hi
I need somebody help with this problrm
when I when running http://localhost/gadgetswarehouse/default.aspx in my browser i'm getting :
Server Error in '/gadgetswarehouse' Application.


Reply By: rwojtowicz Reply Date: 10/3/2005 9:38:26 PM
help me with this program

Reply By: Imar Reply Date: 10/4/2005 1:04:38 AM
I think you're better off posting in one of the other targeted .NET forums located here: http://p2p.wrox.com/default.asp?CAT_ID=11 , as this one is for the book "ASP.NET E-Commerce Prog Problem - Design - Solution" only.

If you do post in another forum, be sure to provide lots more detail than you have done know. "Server Error in '/gadgetswarehouse' Application" and "please help me" is not enough. You'll need to provide more specific error information, explain your setup (e.g. .NET framework, whether you're using VS.NET or not) etc etc otherwise no one knows how to fix this.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply By: gapoce Reply Date: 9/4/2007 8:43:15 AM
Nice - to still have this topic on the web...
Wouldn't it be nice if we could run this on other database systems (MySql etc)!?
Has anybody rewritten the SqlPersistenceContainer stuff?
Combine this stuff with Flex and you get supercharged powerfull stuff :-)

Gapoce

Go to topic 64669

Return to index page 49
Return to index page 48
Return to index page 47
Return to index page 46
Return to index page 45
Return to index page 44
Return to index page 43
Return to index page 42
Return to index page 41
Return to index page 40