Dotnetinfo’s Weblog

Just another WordPress.com weblog

Archive for the ‘RIA’ Category

Silverlight – “Loading Please wait”

Posted by dotnetinfo on November 17, 2009

Silverlight – “Loading Please wait” was my search in google i was not able to find any useful information. I thought how come nobody thought about the loading wait time and started to code using my little knowledge , then came across a great post by dan – http://www.davidpoll.com/2009/09/14/update-2-displaying-background-activity-in-a-silverlight-ria-application/ i added the activity to my DomainDataSource that calls a sybase database not Entity framework. Remember to use the new acitivy dll from dan’s blog not in RIA template.

Posted in RIA, Silverlight | Leave a Comment »

Silverlight – RIA – Sybase without Entity Framework

Posted by dotnetinfo on November 13, 2009

I am in the process of learning RIA with Silverlight. I like the Entity Framework but it wont work for my sybase. At last i found an article  http://msmvps.com/blogs/deborahk/archive/2009/11/05/silverlight-ria-services-and-your-business-objects.aspx

that helped me to create domain objects and connect directly to database. The change i made mainly in domain layer

public static List<SomeData> GetData()
        {
            DataSet dsSome;
            List<SomeData> SomeList = new List<SomeData>();
            try
            {
  //using Entlib you can use any database
                DAL.Database db = DAL.DatabaseFactory.CreateDatabase(“Use Connection String”);              
                dsSome= db.ExecuteDataSet(CommandType.StoredProcedure, “Query’”);
                foreach (DataRow SomeRow in dsSome.[1].Rows)
                {
                    SomeData s = new SomeData ();
                    s.Name = SomeRow ["Name"].ToString();
                    s.Age = SomeRow ["Age"].ToString();
                    SomeList.Add(SomeData);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

         
            return SomeList;
        }

public class SomeData
    {
        [System.ComponentModel.DataAnnotations.Key()]
        public string Name{ get; set; }    
        public string Age{ get; set; }               
    }

In Service Layer
public IEnumerable<SomeData> GetSomeData()
        {
            return Customers.GetData();
        }

In Main.XAML add another grid to display the value

Posted in RIA, Silverlight | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.