im having trouble pulling some specific information out from sharepoint list item. im doing a asp.net form and saved all user inputs into sharepoint list. if all information are there, my code works fine, if some colume is missing(the scenera requires to
do that), it will return a System.NullReferenceException: Object reference not set to an instance of an object
exception. How can i read a null item, and maybe simply assign it to a string such as "NO VALUE", something like that?
i've tried all methods that i can think about, such as system.DBNull.value, or string.empty, or just null.
code is here: this is the save to list code:
private void SaveToTTCVIPList(SPWeb web)
TTCVIPList = web.Lists["TTCVIP"];
TTCVIPList = AddList(web, "TTCVIP", "List for TTCVIP user's information", "Custom List", true);
SPListItem item = TTCVIPList.Items.Add();
if (this.txtJointHolderName.Text == System.DBNull.Value)
item["Joint Holder Name"] = string.Empty;
View Complete Post