【发布时间】:2015-01-06 01:04:09
【问题描述】:
以下是来自 VB.NET 脚本的代码,用于在 RS.exe 脚本文件中设置 DataSource。你能帮我把它转换成C#吗?
整个代码如下。
Dim dataSources(0) As DataSource
Dim dsr0 As New DataSourceReference
dsr0.Reference = "/Aroh/Data Sources/VIPDataSource"
Dim ds0 As New DataSource
ds0.Item = CType(dsr0, DataSourceDefinitionOrReference) ' <=== This line here
ds0.Name = "DataSource1"
dataSources(0) = ds0
ds.SetItemDataSources("/Aroh/TestMe", dataSources)
我尝试使用 ds0.Item = (DataSourceDefinitionOrReference)dsr0 进行转换,但这给了我一个错误。
【问题讨论】:
-
请为您的问题添加适当的标签,假设您正在使用 RS,这可能会有所帮助:phil-austin.blogspot.com/2009/02/…
标签: c# vb.net code-translation