我在OleDbConnection访问同一网络中的Windows共享上的.mdb文件时遇到问题。当它被放置在使用部件的末端时,它需要超过2秒。打开连接并执行查询或填充DataTable只需要50毫秒。
这是我的代码:
#import "EgKernalVClr.h"
@class EgCoreNavigationItemCustomView ;
@class EgCoreNavigationLeftBarCustomView ;
@class EgCoreNavigationRightBarCustomView ;
@class EgCoreNavigationItemBarCustomViewModel ;
@protocol EgCoreVClrNavClrDelegate ;
@interface EgCoreVClr : EgKernalVClr{
@protected
EgCoreNavigationItemCustomView *_navigationItemCustonView ;
EgCoreNavigationLeftBarCustomView *_navigationLeftBarCustonView ;
EgCoreNavigationRightBarCustomView *_navigationRightBarCustonView ;
}
@property (nonatomic , assign) EgCoreVClrNavClrDelegate delegate ;//Error
@property (nonatomic , assign) BOOL autoAdjustLeftBarCustomView ;
@property (nonatomic , assign) BOOL hiddenLeftBarCustomView ;
@property (nonatomic , strong) EgCoreNavigationItemBarCustomViewModel *navigationItemCustomViewModel ;
- (void) addRightCustomViewWithModel:(EgCoreNavigationItemBarCustomViewModel*)customViewModel ;
@end
@protocol EgCoreVClrNavClrDelegate <NSObject>
- (BOOL) leftTriggerAction:(EgCoreNavigationLeftBarCustomView*)sender withEgCoreVClr:(EgCoreVClr *)egCoreVClr ;
- (void) rightTriggerAction:(EgCoreNavigationRightBarCustomView*)sender withEgCoreVClr:(EgCoreVClr *)egCoreVClr ;
@end
基本上&#34;从这里&#34;到这里&#34;到这里&#34;是本准则中最耗时的部分。你有一个想法,为什么它这么慢?
答案 0 :(得分:0)
我也遇到了这个问题,除了性能甚至更差(调用Dispose大约需要20秒)。来自相关问题的建议解决了该问题:将以下内容添加到连接字符串:
OLE DB Services=-1;