开发者

Is it possible to serialize the instance of the SqlDataSource into structured text, such as XML?

开发者 https://www.devze.com 2023-03-05 11:22 出处:网络
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 SqlDataSour

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).

0

精彩评论

暂无评论...
验证码 换一张
取 消