Linq to sql - object designer - Getting values from active object

F

Fritjolf

Hi.

I have a winform and a few texteditfields. These are bound to the
result from a linq query:

var person = ProjectGlobal.rd.ER_Persons.Single(c => c.LogonId ==
ALogonId.ToUpper());

The query gets the person of the entered logon-id. Next, the persons
departments are feched:
var sections = from s in ProjectGlobal.rd.ER_Person_Sections
where s.Person_Id == person.Person_Id
select s;
The results from this query is databinded to a DataGridView. The
result columns is Person_Id and Section_Code. And these two columns
are then shown in the grid.

the problem is: when I add a new record to the grid, I need to set the
Person_Id automatically and let the user choose a section code from a
drop down list in section_code.

#1:
How do I set a value to a grid cell?

#2:
How do I get the person-id from the first query - the active object -
and put it into the cell in the grid?

Thanx in advance,

Fritjolf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top