?
Solved

Help with sending data to a compiled class library.

Posted on 2007-03-28
1
Medium Priority
?
197 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 2000 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

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month13 days, 22 hours left to enroll

809 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