Solved

Help with sending data to a compiled class library.

Posted on 2007-03-28
1
185 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

Suggested Solutions

Title # Comments Views Activity
What namespace do I need to import? 2 29
How to join on ID, with prefix? 15 60
Example works but why do I need to click twice on button 4 43
Footer for each row on Gridview 2 21
Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

810 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