Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing Data into SQL for ASP.NET page

Status
Not open for further replies.

AppzDev

MIS
Oct 9, 2002
57
US
I am importing some data to be viewed on an ASPX page that i created. Nothing fancy really. My question is that the page is having some issues handling <null> values that were imported into the SQL database. I notice that when i &quot;add&quot; someone to the table via the &quot;addpt.aspx&quot; page, when i leave a field blank, it doesn't show as <null> on the SQL side. Is there any way to import data into SQL that will not import a <null> value?

Thanks,

dc~
 
&quot;when i leave a field blank, it doesn't show as <null> on the SQL side&quot; that's because it isn't null.... it's an empty string if you wish to store a null then you need to test for an empty string and send a null

if (txt_name.Text==&quot;&quot;)
parameter=DBNull.Value;
else
parameter=txt_name.Text.Trim();


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top