Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 15th, 2004, 02:59 PM
Authorized User
 
Join Date: Jun 2004
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to hlchuah77
Default Few ASP.NET questions

Question 1

When I create parameter in ASP.NET page as below:

SqlParameter UnitIDParam = new SqlParameter("@UnitID", SqlDbType.VarChar, 50);

I know that my UnitIDParam is in the type of variable-length character with length of 50.

Now please look at the statement below:

SqlParameter RentalPerDayParam = new SqlParameter("@RentalPerDay", SqlDbType.Money);

The above statement work just fine even without declaring its length such as the case for VarChar mentioned above. Do I need to declare the length of the "Money" type or just leave it as the above syntax is already correct? What I worry is that if I do not declare any length for it, the default length of "Money" will be allocated each time the new data is created, which in turn, will consume a lot of memory space.

As you all know, "Money" type will have length within
-922,337,203,685,477.5808 to 922,337,203,685,477.5807


Question 2

Is there any way for me to update more than two tables in database with minimum of coding. For example, currently I use two different Sql statement to update to two different table as below:

string queryString = "INSERT INTO Apartment(AptName, YearConstruct, AptType)" + "Values(@AptName, @YearConstruct, @AptType)";

string queryString02 = "INSERT INTO ApartmentBlock(BlockID, BlockName, AptName)" + "Values(@BlockID, @BlockName, @AptName02)";

Any idea is much be appreciated.





 
Old November 15th, 2004, 03:06 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

1.) That should be fine just as is.

2.) You must code and update for each table as you have. It would be better if you created stored procedures if you call them often, and just pass parameters as necessary.

 
Old November 15th, 2004, 03:55 PM
Authorized User
 
Join Date: Jun 2004
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to hlchuah77
Default

Oh ya, I have got it! Thanks, jbenson001!

 
Old November 17th, 2004, 01:45 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Glad I could help :)







Similar Threads
Thread Thread Starter Forum Replies Last Post
Several questions in asp.net collie General .NET 0 September 30th, 2006 05:58 AM
ASP.NET questions. cstooch Classic ASP Databases 0 May 14th, 2006 02:13 PM
ASP.NET SessionID Questions kwilliams ASP.NET 2.0 Basics 0 April 28th, 2006 02:32 PM
Upgrading to ASP.NET 2.0 Questions Aaron Edwards ASP.NET 2.0 Basics 2 December 11th, 2005 11:51 PM
Styles.CSS and ASP.NET Newbie Questions sstory ASP.NET 1.0 and 1.1 Basics 4 September 29th, 2004 06:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.