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 :
[ServiceContract]
public interface IService1
{
[OperationContract]
string GetItemInfo(string Category);
}
[DataContract]
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:
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