VB6 .NE​​T互操作 - 性能问题性能、操作、问题、NE

2023-09-06 23:23:35 作者:对你何止钟意

我想用消耗在C#应用程序VB6的应用程序。 VB6的应用程序是一个winform应用程序。要做到这一点,我已经修改了VB6应用程序(EXE)到DLL。然后,我在我的C#应用​​程序中引用它。在我的VB应用程序,我有一个新类添加了一些方法,只是为了打开VB形式。

I'm trying to use a VB6 app consumed in a C# app. The VB6 App is a Winform app. To do this, I have modified the VB6 App (EXE) to a DLL. Then I've referenced it in my C# app. In my VB App, I've add a new Class with some methods just to open VB forms.

一切正常......只是如果窗体有许多控件(30),窗口是打开非常缓慢(> 4S,而<在VB 1秒)

Everything works fine... except that if the form has many controls (30), the window is extremely slow to open (> 4s whereas < 1s in VB)

1 /这是方法好?

2 /如何解决此问题?

2/ How to resolve this ?

问候,

弗洛里安

编辑:我知道问题出在哪里,但我不知道如何解决它。这是执行速度很慢的方法,包含SQL字符串十几通过concatened一个;并且该方法 例如:的SqlString =SELECT * FROM客户; SELECT * FROM出版商...... OpenResultSet(strSelect)被称为...组合框填充每个SQL字符串

EDIT : I know where is the problem but I don't know how to resolve it. The method which is very slow to execute contains a dozen of sql string concatened by a ";" and the method ex : sqlString = "SELECT * FROM CUSTOMERS;SELECT * FROM PUBLISHERS..." OpenResultSet(strSelect) is called... a combobox is filled for each sql string

推荐答案

从你写我想看看到底有多少行/列的SELECT * FROM XXXX查询返回。

From what you have written I would look at exactly how many rows / columns your 'SELECT * FROM XXXX' queries are returning.

SELECT *通常被认为是不好的做法,因为它可以有巨大的性能影响(和每一列添加到表在未来将有所放缓,即使你并不需要在该列中的任何数据),如果你有没有WHERE子句的查询将会变慢,每天将数据添加到您的表。

SELECT * is generally considered bad practise as it can have massive performance implications (and will slow down for every column added to the table in the future, even if you don't need any data in that column) and if you have no WHERE clause your query will get slower every day that data is added to your table.

 
精彩推荐