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.
|