odd behavior of binding source, vspro 2012
odd behavior of binding source, vspro 2012
odd behavior of binding source, vspro 2012
odd behavior of binding source, vspro 2012
odd behavior of binding source, vspro 2012
odd behavior of binding source, vspro 2012 odd behavior of binding source, vspro 2012 odd behavior of binding source, vspro 2012 odd behavior of binding source, vspro 2012 odd behavior of binding source, vspro 2012 odd behavior of binding source, vspro 2012 odd behavior of binding source, vspro 2012 odd behavior of binding source, vspro 2012
odd behavior of binding source, vspro 2012 odd behavior of binding source, vspro 2012
odd behavior of binding source, vspro 2012
Go Back  Xtreme Visual Basic Talk > > > odd behavior of binding source, vspro 2012


Reply
 
Thread Tools Display Modes
  #1  
Old 06-04-2013, 02:02 PM
loquin's Avatar
loquinodd behavior of binding source, vspro 2012 loquin is offline
Google Hound

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Arizona, USA
Posts: 12,400
Default odd behavior of binding source, vspro 2012


I've put off moving to .net long enough. So, the latest project is in vb 2012 Pro. It's a utility to 'push' specific part information (and later, Bills of Material data, and then Work Order data) from our ERP Enterprise Resource Planning) system, Oracle based, to the MES (Manufacturing Execution System,) also Oracle Based.

I've attached a copy of a screen shot to show what's going on.

The ERP system is 'InfoPower', the MES system is Solumina. I use the shortcuts IP and Sol to distinguish between the two in variable/object naming.

When the app loads, it fetches the part data from a view in the IP database into a binding source, which in turn is bound to the main datagridview. Then, when a part is selected, that part is queried in the Sol database into separate binding source, and the binding source is used for status info (to let the user know if the part is aleady in the Solumina database.) The second gridview is normally not visible - I made it visible to show what's going on.

I have two procedures (one for IP, one for Sol) which connect to the appropriate database (if not already conencted,) to load the data into the binding source, and bind the data source to the appropriate gridview. Both these two procedures first calls a common connect sub, passing the connection and connection string, Then, each sub calls a common load sub, passing the appropriate connection, binding source, datagridview, and SQL query (in three parameters - the SELECT, the WHERE clause, and the ORDER BY clause)

Here's the kicker: even though you have so much common code, the IP data is fetched and displayed properly, but the Solumina data is not - instead, the binding source is Metadata (field counts, etc.) It SHOULD be showing the part number, part rev, description, etc., from the Solumina part table. Even if the part isn't present in the table, it should show the headers. The field count is right, though. (the final version only shows a subset of the total fields - about 10 fields, total)

Originally, the app was using a dataset/binding navigator, bindingsource/datagridview, but the performance was abysmal - 20 seconds to load the ERP part data. The MES binding source and grid contained valid part data, though. Now that I've removed the dataset and binding navigator, performance is OK - less than 2 seconds to load 25K records.

Anyone seen this behavior before?
Attached Images
File Type: png IPSol.png (84.2 KB, 4 views)
__________________
Lou
"I have my standards. They may be low, but I have them!" ~ Bette Middler
"It's a book about a Spanish guy called Manual. You should read it." ~ Dilbert
"To understand recursion, you must first understand recursion." ~ unknown

Last edited by loquin; 06-05-2013 at 07:27 AM.
Reply With Quote
  #2  
Old 06-04-2013, 03:16 PM
loquin's Avatar
loquinodd behavior of binding source, vspro 2012 loquin is offline
Google Hound

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Arizona, USA
Posts: 12,400
Default

for example, in the screen dump, above, the SQL to load the ERP binding source is:
Code:
SELECT * FROM SOLUMINA_INTERFACE_PART ORDER BY ITEM_NO
(SOLUMINA_INTERFACE_PART is an Oracle view to retrieve only the data needed from the rather large part table.)

And, when selecting the first row of the grid, The SQL to retrieve the MES parts data is:
Code:
SELECT * FROM SFPL_ITEM_DESC_MASTER_ALL WHERE PART_NO = '2-010 (E540-80)' and PART_CHG = '-' ORDER BY PART_NO, PART_CHG
Note - there should NEVER be more than one record retrieved here, as PART_NO and PART_CHG are the the primary key on this table.
__________________
Lou
"I have my standards. They may be low, but I have them!" ~ Bette Middler
"It's a book about a Spanish guy called Manual. You should read it." ~ Dilbert
"To understand recursion, you must first understand recursion." ~ unknown

Last edited by loquin; 06-05-2013 at 07:31 AM.
Reply With Quote
  #3  
Old 06-06-2013, 10:12 AM
loquin's Avatar
loquinodd behavior of binding source, vspro 2012 loquin is offline
Google Hound

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Arizona, USA
Posts: 12,400
Default

Follow-up: It appears that this behavior may be intentional in the bindingsource. (Although it is different behavior when using a dataset, as opposed to issuing SQL commands with the command object)

If there are zero records returned, when using the Dataset, the field names will be provided. When using the Command Object, only the query metadata is returned.

This implies that, as the Dataset contains field data, ONLY the dataset provides the field collection to the binding source.

This behavior shoots the old approach of intentionally querying the database table/view with a where clause of 'WHERE 1 = 0' or 'WHERE TRUE = FALSE' in order to obtain the fields collection .
__________________
Lou
"I have my standards. They may be low, but I have them!" ~ Bette Middler
"It's a book about a Spanish guy called Manual. You should read it." ~ Dilbert
"To understand recursion, you must first understand recursion." ~ unknown
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
odd behavior of binding source, vspro 2012
odd behavior of binding source, vspro 2012
odd behavior of binding source, vspro 2012 odd behavior of binding source, vspro 2012
odd behavior of binding source, vspro 2012
odd behavior of binding source, vspro 2012
odd behavior of binding source, vspro 2012 odd behavior of binding source, vspro 2012 odd behavior of binding source, vspro 2012 odd behavior of binding source, vspro 2012 odd behavior of binding source, vspro 2012 odd behavior of binding source, vspro 2012 odd behavior of binding source, vspro 2012
odd behavior of binding source, vspro 2012
odd behavior of binding source, vspro 2012
 
odd behavior of binding source, vspro 2012
odd behavior of binding source, vspro 2012
 
-->