S
scott ocamb
Hello,
I have a function that expects the following parms. How can I handle null
values. For example, if FirstName comes through as null, how can i propogate
that null value to the stored procedure.
public long InsertPerson(string FirstName, string LastName, string
MiddleName, string EMail, long PersonTypeId,
string HomePhone, string CellPhone, bool EmailOptOut, string City,
long StateId, string PostalCode, string Street, long CountryId, long
InsertUserId)
{
using (SqlConnection cn = new SqlConnection(this.ConnectionString))
{
SqlCommand cmd = new SqlCommand("ks_Person_InsertPerson", cn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@FirstName", SqlDbType.VarChar, 30).Value =
FirstName;
cmd.Parameters.Add("@LastName", SqlDbType.VarChar, 30).Value =
LastName;
I have a function that expects the following parms. How can I handle null
values. For example, if FirstName comes through as null, how can i propogate
that null value to the stored procedure.
public long InsertPerson(string FirstName, string LastName, string
MiddleName, string EMail, long PersonTypeId,
string HomePhone, string CellPhone, bool EmailOptOut, string City,
long StateId, string PostalCode, string Street, long CountryId, long
InsertUserId)
{
using (SqlConnection cn = new SqlConnection(this.ConnectionString))
{
SqlCommand cmd = new SqlCommand("ks_Person_InsertPerson", cn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@FirstName", SqlDbType.VarChar, 30).Value =
FirstName;
cmd.Parameters.Add("@LastName", SqlDbType.VarChar, 30).Value =
LastName;