开发者

VB6 .NET Interop - Performance issue

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.

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

1/ Is this method good ?

2/ How to resolve this ?

Regards,

Florian

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


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

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜