Solved

Help with sending data to a compiled class library.

Posted on 2007-03-28
1
183 Views
Last Modified: 2013-12-17
Hi!
I am writing a C# (.net 2.0) windows application that searches information, contained in a dataset, against a user defined query (typically a string). The application must operate at near real-time and so performance is critical to my solution. For the purposes of this question I will refer to the application code as 'theApplication'.
As I would like to use the same type of functionality in a number of applications I have created a class library (QueryEngine) that contains all of the query instructions. The QueryEngine is compiled seperatly and TheApplication references the compiled .dll .
The QueryEngine will need to receive a datatable (containing information for the comparison) and a string to query the datatable against. Each application accessing the QueryEngine will have a datatable containing the information required for the QueryEngine AND additional information specific to the application.

All of the information will be held in RAM.

What is the best way to send information to the QueryEngine? Should I use an internal dataset within the QueryEngine and convert (cast?) a sub-set of the accessing applications datatable?

Regards

John
0
Comment
Question by:johnwalden869050
1 Comment
 
LVL 41

Accepted Solution

by:
graye earned 500 total points
Comment Utility
The best way to design a QueryEngine class would be to create individual properties for all of the "inputs".   For example, you could have a Property for "ServerName", "ConnectString", "QueryString", etc.   Then you could create a method that generated the "outputs".   For example, you could have a method called "ExecuteQuery" that returned a DataTable.

That's the power of classes... you can pass data back and forth between your applicaion and the compiled Class DLL via the properties and methods of the class.

In your application it'd look like this:

QueryEngine qe = New QueryEngine;

qe.ConnectString = "xxxxxxxxxxxxxx";
qe.QueryString = "Select * From Table1 Where Field1=1234"

DataTable dt = qe.ExecuteQuery();
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now