I have database table: tblPerson as,
id name mobile_no sentcount
1 Ram 98******** 4
2 Shyam 98******** 4
3 Hari 98******** 5
4 Raj 98******** 3
now i want send sms to those two person who have sentcount less than the maximum sentcount.(here maxm sentcount=5);
i used sql storeproc as:
create proc sp_getMobileNo
@sentcount int
as
Select (select top 2 mobile_no + ',' as 'data()' from tblPerson where sentcount<@sentcount ORDER BY NEWID()for xml path('')) as MobileNo
it gives the result as:
MobileNo
----------------------
98********, 98********
-----------------------
I have used linq to get the data in the ASP.Net application C# as language and succeded to send text message to two selected numbers;i used linq as:
linqDataContext db= new linqDataContext();
var query=db.sp_getMobileNo(5);
string mobileNum=query.MobileNo;
but i want to update or increase the sentcount of those two whom sms has been sent.
So please suggest me what to do? Is the way of retreving the mobile in concated form as xml path the correct way to retreive the mobile number?
Please help!!!