Hi….
Can anyone give me a sample web application or the code required to do the below scenario which I wiil explain. (code for similar scenario is also can be given)
I have two tables in my database (SQL Server 2005 express edition)
Table 1 : Department
DeptCode as nvarchar(300) à Primary Key
Department as nvarchar(4000)
Table 2 : Employee
EmpCode as nvarchar(300) à Primary Key
EmpName as nvarchar(300)
Deptcode as nvarchar(300) à Foreign Key From Department Table
I am using ASP.NET application in C# and am using 3 tier architecture .
In my form there is two textboxes for Department Code and Department Name and
I have a gridview which will have employee names. I want to save these in the above two tables on "Save" button Click.
Can anyone give me the generic DAL for insert, update, delete etc for these, BL and presentation layer. Need stored procedures for inserting data to two tables at a time .
Here DeptCode should be unique so duplicate checking also should be done in Stored procediures or in form.
I want to use one Stored procedure to insert both tables.
The result of this will be like this as shown below
Department
DeptCode Department
D1001 IT
D1002 HR
Employee
EmpCode EmpName DeptCode
E1001 Sam D1001
E1002 Ram D1001
E1003 Sunil D1002
E1004 Shekhar D1002
Anyone can email me the sample forms and code to my email id also [email protected]
Please include DataAccessLayer class not for each table , a generic layer , BL of each class (department, employee) and a sample aspx page.
Any code similar to above scenario is also ok for me , just to know how to start a basic good asp.net web application.
Thanks and Regards
Sankar