开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜