0
Reply

Getting a random data

Ask a question
programci

programci

11y
1k
1

Hello everybody,

I am trying to make an app that gets random words form the database and shows them on a textblock. My codes worked really well on forms but when I got into phone I learnt that Windows phone doesn't have a direct connection with an sql DB(which is really bad). I tried to make WCF service but I couldn't. I was following this tutorial: http://www.c-sharpcorner.com/uploadfile/UrmimalaPal/creating-a-windows-phone-7-application-consuming-data-using-a-wcf-service/

But the things that we do are different so I couldn't use it . NOw here is my select query for sql:

select * from TABLE where ID = cast((select MAX(ID) from table) * RAND() as int) + (select MIN(ID) from table)". I tired to converti t to Linq but  it didn't help me.

SO my question is where am I suppose to add this query(linq version of this) in WCF in order to add it to my application. Can you please make it clear?

I am waiting for your answers

PS. I need help asap![Also I am using Windows phone 8 but 7 and 8 are not so different from eac other about data connections]

Thank you and have a great day!