用企业库提高WPF的性能 [英] Improving Performance for WPF with Enterprise Library

查看:65
本文介绍了用企业库提高WPF的性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我们的WPF应用程序遇到了一些性能问题。我们正在使用带有PRISM的WPF,而对于我们正在使用企业库的数据层。我们有搜索屏幕,我们将提供10个搜索条件,当我们搜索一个值时,SP会快速返回值,但在Enterprise Library中我们使用executereader这样的东西



Hi there,

We are having some performnace issues with our WPF application. We are using WPF with PRISM and for data layer we are using Enterprise Library. We have search screen where in we will provide 10 search criteria's , When we search for one value, SP is returning the values quickly but in Enterprise Library we use executereader some thing like this

  int changeUserIDOrdinal = reader.GetOrdinal("ChangeUserID");
                        int changeDateOrdinal = reader.GetOrdinal("ChangeDate");

                        while ((reader.Read()))
{
var screenField = new VisitField();
if (!reader.IsDBNull(changeUserIDOrdinal))
                            {
                                screenField.ChangeUserID = reader.GetInt32(changeUserIDOrdinal);
                            }
                            if (!reader.IsDBNull(changeDateOrdinal))
                            {
                                screenField.ChangeDate = reader.GetDateTime(changeDateOrdinal);
                            }
                            screenFields.Add(screenField);
}





因此,它将迭代数据并填充集合并将集合绑定到ViewModel中的Property。但是我们有时会获得40K的记录,而且我们正在连接所有这些事情。





对于用户界面,我的数据网格有以下属性,





So it will iterate the data and fill the collection and bind the collection to Property in the ViewModel. But we are getting 40K records some times and we are getting connection time out all these things.


For the UI, I am having following properties for my Data Grid,

VirtualizingStackPanel.IsVirtualizing="True"
                         VirtualizingStackPanel.VirtualizationMode="Recycling





有没有更好的方法来改善数据库端和WPF端的性能?





谢谢,

Kiran



Is there any better way to improve the performance on DB side and WPF side ?


Thanks,
Kiran

推荐答案

这篇关于用企业库提高WPF的性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆