Insert (Save) data into Foreign and Primary Table using C# and VB.Net in ASP.Net

Last Reply 8 months ago By pandeyism

Posted 8 months ago


I have 2 tables: Member and Project and a foreign key in Member, the ProjectId(primary key) from table Project.

How to extract the ProjectId from table Member, using C# language?

2 tables with their fields:

Member: MemberId-primary key,FirstName,LastName,Email, Project and a foreign key ProjectId

Project:ProjectId-primary key,Allocation,Pers1,Pers2.

So, I want to insert a new member in Member. I don't know how to get the foreign key ProjectId.

I want an alternative without Stored procedure.