Click here to Skip to main content
15,911,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there.

I'm busy doing a Windows 7 Phone App and struggling with storage.
I need to save a list of products and retrieve it.
I've tried the following: Isolate Storage, SQLServer Azure, WCF. My last resort is Filestreams.

DESPERATE HELP PLEASE!!!
Posted
Comments
[no name] 17-Mar-12 16:02pm    
And your problem is what exactly?

look man you have to add WCF layer to your project then in this WCF Create Custom Class and the function that retrieves data from data base as any web application (if you have experience in WCF)!!!!!
example: in service.cs :
C#
[ServiceContract]
    public interface IService1
    {

        [OperationContract]//dont miss this 
        string GetItemInfo(string Category);
    }

    [DataContract]//dont miss this 
    public class Items
    {
        public string ID { get; set; }

        public string Category { get; set; }

        public string Info { get; set; }

        public int Quantity { get; set; }

        public string Mark { get; set; }

        public int Price { get; set; }
    }

and in service.svc.cs ex:
C#
string connection = ConfigurationManager.ConnectionStrings["Connection"].ToString();
        public string GetItemInfo(string Category)
        {
            Items items = new Items();

            SqlDataReader reader = null;
            SqlCommand cmd = new SqlCommand("select top(1) ID, Category, Info, Mark, Quantity, Price from item where category ='" + Category + "'");
            SqlConnection conn = new SqlConnection(connection);
            conn.Open();
            cmd.Connection = conn;
            reader = cmd.ExecuteReader();
            if (reader.Read())
            {
                items = new Items();
                items.ID = (string)reader["ID"];
                items.Category = reader["Category"].ToString().Trim();
                items.Info = reader["info"].ToString().Trim();
                items.Mark = reader["Mark"].ToString().Trim();
                items.Quantity = Convert.ToInt16(reader["Quantity"]);
                items.Price = Convert.ToInt16(reader["Price"]);
            }
            conn.Close();
            return items.Info;
        }



and also you can use sqlite, google it

Regards
 
Share this answer
 
Go through the below link, this may helps you
Here[^]

Thanks
--RA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900