Last post Oct 05, 2016 11:11 AM by markfitzme
Sep 30, 2016 07:10 PM|wonjartran|LINK
I have a VS2010/ASP.NET4 website. On a webpage with a DDL and 3 ListViews. The DDL will select an EmpID to open the 3 ListViews for Edit records and Add new records to the SqlDataSource.
The Add function of the ListView displays an Insert and a Cancel buttons, and textboxes for entering the new data. Two ListViews showed an empty textbox for the EmpID, while the other one did not display a textbox for the EmpID. It did show textboxes for
Why? Any reason why no textbox for entering the EmpID. In those 3 database entity tables, EmpID is set to be the primary key. How do I control the EmpID PK be auto-set or textbox entry?
Oct 02, 2016 05:27 AM|Cathy Zou|LINK
Form your description. I am not quite clear about you problem, would you please provide us with some code about your problem and more detailed description?
Oct 04, 2016 08:53 PM|wonjartran|LINK
I think I understood why there is no textbox for entering the EmpID. Reviewing the schema of the database, I found the Identity property of EmpID is set to true. That is the EmpID will have the Autonumber.
Oct 05, 2016 11:11 AM|markfitzme|LINK
If one of the entity tables doesn't have the primary key as something that isn't going to auto-populate (like a sql identity column) then it will need to make entry available. Normally though, you never want the primary key to be available for data entry
except in cases where you are generating data that would be used for development purposes such as a lookup table of set values that you have enums based upon.