Database output in textbox

Results 1 to 2 of 2

Thread: Database output in textbox

  1. #1
    Join Date
    Dec 1969

    Default Database output in textbox

    Hi,<BR>I want to put my database output in textboxes in mij ASPX page. <BR>I used a dataset and filled it with the database record, but everytime when a item is empty i get the following message:<BR><BR>Cast from type &#039;DBNull&#039; to type &#039;String&#039; is not valid. <BR><BR>I know I can build an if statement, but there&#039;s got to be a better way to solve my problem<BR><BR>Please HELP me.<BR><BR>Many thanks<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Database output in textbox

    check if the value is null - dbnull is type you can check for.<BR><BR>or use the old asp trick of trimming all your fields from the db<BR><BR>strSummat = trim(&#060;your value from the DB here&#062;)<BR><BR>then if it was null, it will now be an empty string, so just test for that<BR><BR>ten set you input box value to be strSummat<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts