5
Answers

Entity framework -Linq

Photo of Amenda Aisha

Amenda Aisha

8y
243
1
I have two table called Change Request and Task list
change request has one or many task ,
task list task is belongs to an exactly one change request
so in a different form there is a combo box which contain change request ids from change request table ----> here my requirement is to display task list data in a datagrid when selecting a change request id
furthermore it should search for that selected id with the task list table and retrieve only matching records.
 
here is my code
----------------------------------------------
// load task detalis
private void LoadtaskList()
{
//cr id from change request table -----> match with task table and get data belongs to that cr id
var crId = Int32.Parse(cbsearch.SelectedValue.ToString());
BindingSource task = new BindingSource();
task.DataSource = db.cr_tasks.Where(e => e.change_request_id == crId && e.is_active == true)
.Select(x => new
{
x.task_id,
x.task_name,
x.responsible_person,
x.service.name,
x.task_start_date,
x.task_completion_date,
x.is_completed_status,
x.service_id
}).ToList();
if (task.DataSource != null)
{
dgvtask_details.DataSource = task;
}
}
 

Answers (5)

0
Photo of Mahesh Chand
2 286.9k 123.8m 15y
1. First, you have a shared database and all these users are on same Network. They will share same database and database can be a SQL Server database. I am not sure if you can do this. If database is Access, it can be placed on a shared drive.

2. Whenever you update your application and database, you will have to let your users download the latest version and replace the old version with this new version.

3. Yes, you will have to build a setup program so your users can run it.

4. If you do not want your users to handle any of the work, you can build a Website and they just have to go to the URL and you control both application and the database.

5. You can build a Web Service and your client applications (on user machines) will call Web Service and web service will sit on top of the shared database.



Accepted
0
Photo of patrick
NA 422 0 15y
Okay, so I use an access database on a shared drive. Thats fine. I can set it up fine, and have others access it fine. I run into problems with serializations though, so I made a work-around by serializing to a shared binary file. I REALLY don't want to do this, but I can't seem to serialize a class instance and store it in the access DB.
What classes work best with access databases? I've been using ADODB.
0
Photo of Danatas Gervi
NA 1.4k 0 15y
May be  Firebird ?