locked
making an int field in a table null RRS feed

  • Question

  • hi guys!

    i have a windows form named form1 and a tblEmp with the following fields;

    id int, Fname text, Lname text, Dob datetimepicker and age int

    i also have on form1 two buttons Save and Retrieve and a textbox for searching by id #

    the save button works fine, if i save a record with no age it saves and that's fine

    but when i click the retrieve button;

    the information come up which is great but age come up as 0;

    in the table i made the age field (allow null)

    can someone help me?

    i tried age.text = "";

    and it's still saving a 0 in the age field in the table.

    i want the field to be blank when i click the retrieve button.

    • Moved by Kristin Xie Thursday, October 30, 2014 6:23 AM
    Wednesday, October 29, 2014 6:21 AM

All replies

  • i think that an int can't be null, at least on code, try using -1, and using it as null.
    Wednesday, October 29, 2014 6:47 AM
  • Hi friend,

    >>I have a windows form named form1 and a tblEmp with the following fields;

    From this message, you are doing a winform application, so I will move your case to winform general forum for better support.

    By the way, could you please post some code here, it would be better to help us your Scenario.

    Have a ncie day!

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, October 30, 2014 6:22 AM
  • Hello Nathaniel.Ja,

    Can you provide more details about this issue? If age is an int value, how can you set age.text=""; ?

    Also what is written in your retrieve click event? We have no idea about your actions.

    Regards,



    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, October 30, 2014 9:18 AM