我需要处理多个函数,并执行返回相同类型记录的结果.考虑到我的功能,我在visual studio 2010下使用c#:
class Search{
public list<wrecords> GetrecordsofAAA(string term);
public list<wrecords> GetrecordsofBBB(string term);
public list<wrecords> GetrecordsofCCC(string term);
}
Run Code Online (Sandbox Code Playgroud)
我用这种方式调用函数
list<wrecords> records1 = Search.GetrecordsofAAA(heart);
list<wrecords> records2 = Search.GetrecordsofBBB(heart);
list<wrecords> records3 = Search.GetrecordsofCCC(heart);
Run Code Online (Sandbox Code Playgroud)
这是系列处理.
如果可能的话,我需要同时填写记录1,记录2和记录3.
我试图并行执行一些进程.这是我第一次这样做,尝试:使用System.Threading.Tasks; 任务将以红色标出:
The Type or namespace name "Tasks" does not exist in the namespace System.Threading(are you missing an assembly reference?)
Run Code Online (Sandbox Code Playgroud)
我该如何解决!?
c# parallel-processing visual-studio-2010 task-parallel-library
我在放置在绑定到对象数据源的数据列表中的内容占位符中有动态内容.问题是我需要检查EVAL的值.这是代码:
<asp:DataList ID="DataList1" runat="server" CellPadding="4"
DataSourceID="ObjectDataSource1" ForeColor="#333333">
<AlternatingItemStyle BackColor="White" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<ItemStyle BackColor="#EFF3FB" />
<ItemTemplate>
<a href="<%# Eval("VendorLink") %>"> <%# Eval("Vendor") %></a>
<br />
<a href="<%# Eval("TitleLink") %> "><%# Eval("Title") %></a>
<br />
<asp:Label ID="DescLabel" runat="server" Text='<%# Eval("Desc") %>' />
<br />
<asp:Label ID="DetailsLabel" runat="server" Text='<%# Eval("Details") %>' />
<br />
<asp:Label ID="RptIDLabel" runat="server" Text='<%# Eval("RptID") %>' />
<br />
<asp:Label ID="LinksLabel" runat="server" Text='<%# Eval("Links") %>' />
<br />
<br /> …Run Code Online (Sandbox Code Playgroud) 我有2个表,1个叫做SourceProperties.另一个叫做属性.
源可以有许多属性.
SourceProperties包含以下属性或列(SourceID,PropertyID,Value).属性包含以下属性或列(PropertyID,PropertyType,PropertyName).
例如,
Select * from SourceProperties where SourceID=1
Run Code Online (Sandbox Code Playgroud)
将返回以下内容
1 33 www.google.com/,...m,sand
1 34 true
1 35 Journal
1 77 false
Run Code Online (Sandbox Code Playgroud)
另外,
Select * from Properties where PropertyID=34
Run Code Online (Sandbox Code Playgroud)
将返回:
34 bit IpAuthenticated
Select * from Properties where PropertyID=77
Run Code Online (Sandbox Code Playgroud)
将返回:
77 bit ContainsBooks
Run Code Online (Sandbox Code Playgroud)
我的问题是,如果我需要选择某个SourceID的所有属性值,这样我就可以得到这样的结果
1 wwww.google.com true Journal false
我能做什么?thx在先进!
我需要创建一个函数来舍入这样的数字:
33120-> 34000
21001-> 22000
这里没有小数点,但如果在最后3位数中存在1以外的数字,则必须增加第4位,最后3位应设为0.
我需要优化的东西,我不想遍历每个数字的每个数字,因为我有超过800,000的数字.
提前致谢!