07-20-2009 05:31 PM
I know there are already samples of accessing OLEDB2 provider programatically, but I wanted to share another and offer some views on how the provider could be used in code for certain operations...
Included in attachment is source code + samples.dll (extract to tools directory) and connections.udl file (extract to \Act for Windows directory and configure for your system).
In this example I'm retrieving the avg of all closed won opportunities and displaying it in the Opportunity control. I'm using the OLEDB2 provider because I can query this quite simply using a SQL statement and aggregate functions and I've found SQL handles these types of operations fairly efficiently. If you find yourself writing code that pulls a list then iterates through the list in a cursor based operation comparing data values you might want to consider rewriting your code to use the provider and set based operations. In general a foreach or while loop through a API generated list to evaluate data is going to be more resource intensive than a SQL query for the same list. You can still cast your SQL results into an array and loop through the results for data posting via the SDK even though the data arrived from the provider.
Any additional input?
04-07-2010 12:58 PM
Ok, trying to test your sample.dll
Found control. Modified udl for my database - tested fine
Added control to Opportunity form
Nothing shows up - am I missing something?
02-20-2012 02:02 AM - edited 02-20-2012 02:27 AM
Hi there, i m kinda new in act programming and i want to learn how to create such an act addons , could u please give more info about how to run your plugin. i use act premium 2011 ,
also if i run it, how can i know it works ? where will be the data, you get from DB , show in act (oportunity or oportunity list )? should i do sth else to view this avg ? it is stated that it will be on oportunity controll but how can i get this controll ? .
with what language is it created ?