-2

I am creating advance search facility in one of my application. In that functionality i have to store selected search criteria. My search result is based on Logi XML...Logi XML requires SQL inline statement so that reason i have to store sql inline query into database table.

I have below tables in my current database.

Employee            Salary             PresentInfo
ID                   ID                    ID
Name                EMPID                 SalaryID
City                Basic                 TotalDays
State               HRA                   PresentDays  
Zip                 PF
Phone               DA

Now user can select any criteria from above tables. I am managing selected criteria into session context. I mean to say i have all the selected details by user. I want to create dynamic sql inline statement in business logic with respective joins.

below function in business logic class

public string GetDetails(List<Class1> Entity)
{
     //What should I write here? I have all the data in entity class
}

So if anyone have any idea about this scenario than please help me in this. Thanxs in Advance.

user968441
  • 1,471
  • 9
  • 22
  • 48

1 Answers1

1

Here is a very brief 3 points you can start with [I am assuming you want employee records for a given id]:

public Employee GetEmployeeDetails(int employeeId)
{
    //Create a connection to the data source

    //Query against datasource and get the result to a Employee with given employeeId

    //get the result and assing values to an employee instance

    //return employee
}
Shiham
  • 2,114
  • 1
  • 27
  • 36
  • No man you are not getting my question well. I need sql query like select statement which saves in database table. I mean i want to store search result and user can see again...Thats it.. – user968441 Jul 15 '12 at 17:30
  • Soething like this? `INSERT INTO Queries (SELECT e.id FROM Employee e)` For this you need to have table called **Queries** – Shiham Jul 15 '12 at 17:38
  • No dear you are not getting my point...have u any communication site account like gmail?? – user968441 Jul 15 '12 at 17:48