Save datatable as user setting

后端 未结 3 1040
你的背包
你的背包 2021-01-15 00:37

I currently try to save a datatable as a user setting using die old \"properties.settings.default.save()\" method.

It does not work. My Settings don\'t get saved. ho

3条回答
  •  离开以前
    2021-01-15 01:21

    I believe I encountered this same problem while performing a LINQ query on a DataTable from an ERP database. After using the CopyToDataTable() method on the query result and assigning it to the settingTable setting, I verified that neither the resultTable nor the settingTable were null and I ran the Settings.Default.Save() method. However, I received a null error when I subsequently attempted to assign the settingTable to a dataTable variable.

    I resolved this problem by assigning the settingTable.TableName property to something other than its default value (the null string) before running the Settings.Default.Save() method.

    Note: The ERP system is really slow, I would just query the data directly using the ERP's business objects.

提交回复
热议问题