How to insert only five values a an ID in SQL and C#
i want to add only five subject marks for each student...how i will restrict an Stduent_ID ?if Stduent_ID=1 and inserted five times then for six entry i should not add...how i will do it in C# + SQL.


Praveen SreeramRank #134 · 16.8K reputationPosted Jun 22, 2016, 8:12 PM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Jun 21, 2016, 11:57 PM EDT
Vinay SinghRank #604 · 4K reputationPosted Jun 22, 2016, 1:24 AM EDT
Praveen SreeramRank #134 · 16.8K reputationPosted Jun 22, 2016, 2:50 AM EDT
Muhammad Aamir7 reputationPosted Jun 22, 2016, 8:10 PM EDT
FROM CourseSemOne
where Student_ID=3 Group by Student_ID )
if(@Counter >= 6)
print'Sorry! You cannot add more than five subject data for a single stduent'
else
print 'Insert Query'
Muhammad Aamir7 reputationPosted Jun 22, 2016, 8:15 PM EDT
Praveen SreeramRank #134 · 16.8K reputationPosted Jun 22, 2016, 8:17 PM EDT
Praveen SreeramRank #134 · 16.8K reputationPosted Jun 22, 2016, 8:20 PM EDT
Muhammad Aamir7 reputationPosted Jun 23, 2016, 12:20 AM EDT
Vinay SinghRank #604 · 4K reputationPosted Jun 23, 2016, 12:39 AM EDT