Unable to Insert the data using mvc4

Posted by Manorama under ASP.NET MVC on 9/2/2013 | Points: 10 | Views : 1466 | Status : [Member] | Replies : 4
I attached one file ,in this file i have five columns .Inside Particulars Column i have no .of sub columns .How i will insert the data into sql server 2008.

Please help me

Thanks & Regards

Manorama

ManoRama


Responses

Posted by: Allemahesh on: 9/2/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
You can use the below sql tables and inser the data into these tables.

1. Period
- PeriodID int, PK
- MonthlyAmount int,
- NoofMonths int,
- AnuualAmount int


2. Particulars
- ParticularsID int, PK
- PeriodID int, FK
- Particulars varchar(max)


Example:-

PeriodID | MonthlyAmount | NoofMonths | AnuualAmount
1 | 500 | 12 | 6000
2 | 600 | 12 | 7200
3 | 1000 | 12 | 12000

Particulars | PeriodID | Particulars
1 | 1 | Rent Paid By Employee
2 | 2 | Life Insureance Premium
3 | 3 | National Savings Scheme

Happy Coding.

Manorama, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Manorama on: 9/2/2013 [Member] Starter | Points: 25

Up
0
Down
Thanks for your reply ,but

How to insert data for two tables .

ManoRama

Manorama, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 9/2/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Better to show the source file content in the post only...
Some of the fellows does not have download permission in their office...


Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Manorama, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Manorama on: 9/2/2013 [Member] Starter | Points: 25

Up
0
Down
<tr>
<span style="font-weight: bold; font-size: 16px; text-decoration: underline">HRA Exemption
</span>
<td>
1
</td>
<td>
<span style="font-weight: bold;">Rent paid by Employee </span>(For employees who
have joined during the year, the rent amount should only be from date of joining
the company till the year end. For Others it should be for the full year.)
</td>
<td>
@Html.TextBoxFor(E => E.MonthlyAmnt, new { @Id = "txtRPBEMonAmntId", @class = "input-main-box", onkeypress = "return AllowNumbersOnly(this,event)" })
</td>
<td>
@Html.TextBoxFor(E => E.NoOfMnths, new { @Id = "txtRPBENoMonthsId", @class = "input-main-box", onkeypress = "return AllowNumbersOnly(this,event)", onkeyup = "mulData()" })
</td>
<td>
@Html.TextBoxFor(E => E.RentPaidByEmp, new { @Id = "txtRPBEAnnAmntId", @class = "input-main-box", onkeypress = "return AllowNumbersOnly(this,event)" })
</td>
</tr>
<tr>
<td>
1
</td>
<td>
<span style="font-weight: bold;">Rent paid by Employee </span>(For employees who
have joined during the year, the rent amount should only be from date of joining
the company till the year end. For Others it should be for the full year.)
</td>
<td>
@Html.TextBoxFor(E => E.MonthlyAmnt, new { @Id = "txtRPBEMonAmntId", @class = "input-main-box", onkeypress = "return AllowNumbersOnly(this,event)" })
</td>
<td>
@Html.TextBoxFor(E => E.NoOfMnths, new { @Id = "txtRPBENoMonthsId", @class = "input-main-box", onkeypress = "return AllowNumbersOnly(this,event)", onkeyup = "mulData()" })
</td>
<td>
@Html.TextBoxFor(E => E.RentPaidByEmp, new { @Id = "txtRPBEAnnAmntId", @class = "input-main-box", onkeypress = "return AllowNumbersOnly(this,event)" })
</td>
</tr>
like that i have no.of columns are there .Please help me

ManoRama

Manorama, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response