Solved

Help with sending data to a compiled class library.

Posted on 2007-03-28
1
187 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
ID: 18822995
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

831 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