I'm developing an in-house ASP.Net application, due to some reason, I've to create dynamic page with dynamic created SqlDataSource(s). So, I'm finding a way to serialize and persist the SqlDataSource instance(s) to structured text(s) (e.g. XML), and later on de-serialize back from the structured text(s), then instan开发者_Go百科tiate the corresponding object(s) of SqlDataSource.
Please kindly advise the simplest way to do that.
Thank you!
William
Simplest way will be to serialize relevant properties (such as Connection String, SelectCommand) - these are any way strings. For de-serializing, just create a new SqlDataSource
and set these properties (or pass them via constructor).
精彩评论