E
Earl
VS2005 app with SQL2k and stored proc.
Using a strongly-typed dataset, I've noticed that on Insert, my columns that
should be null are instead showing as empty. For example, using either of
these three example pieces of code with the textbox remaining empty, I still
get an empty string where the column in the new row should remain null.
EXAMPLE 1
if (txtMiddle.Text != null)
{
rowContact.MiddleName = txtMiddle.Text;
}
EXAMPLE 2
if (txtMiddle.Text != null)
{
rowContact.MiddleName = txtMiddle.Text;
}
else
{
rowContact.SetMiddleNameNull();
}
EXAMPLE 3
if (txtMiddle.Text != null | txtMiddle.Text != "")
{
rowContact.MiddleName = txtMiddle.Text;
}
else
{
rowContact.SetMiddleNameNull();
}
Using a strongly-typed dataset, I've noticed that on Insert, my columns that
should be null are instead showing as empty. For example, using either of
these three example pieces of code with the textbox remaining empty, I still
get an empty string where the column in the new row should remain null.
EXAMPLE 1
if (txtMiddle.Text != null)
{
rowContact.MiddleName = txtMiddle.Text;
}
EXAMPLE 2
if (txtMiddle.Text != null)
{
rowContact.MiddleName = txtMiddle.Text;
}
else
{
rowContact.SetMiddleNameNull();
}
EXAMPLE 3
if (txtMiddle.Text != null | txtMiddle.Text != "")
{
rowContact.MiddleName = txtMiddle.Text;
}
else
{
rowContact.SetMiddleNameNull();
}