Hi,
I use ASP.NET/C#/MS SQL and I'm trying to do the following but I find it
very hard!
I have Stored Procedure which saves data from the Application into DataBase.
One of its parameters is @Rooms INT. When A user insert in the WebForm a
value everything is allright because I do this:
cmd.Parameters.Add(new SqlParameter("@ROOMS", SqlDbType.Int));
cmd.Parameters["@ROOMS"].Value = Int32.Parse(RoomsTB.Text.Trim());
where cmd is SqlCommand and RoomsTB is the TextBox from where I take the
value.
When the user doesn't insert value in the TextBox there is an error because
the Stored Procedure doesn't receive value for the Parameter @ROOMS. How
could I send to the SP NULL for this parameter when there isn't value in the
TextBox?
Thank you in advance!
Viktor
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.729 / Virus Database: 484 - Release Date: 27.7.2004 a.