Solved

Help with sending data to a compiled class library.

Posted on 2007-03-28
1
190 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

687 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