Pages: << 1 ... 6 7 8 9 10 11 12 13 14 15 16 ... 105 >>

21/07/10

Permalink 01:37:23 pm
Categories: .NET

Early-bird period extended to August 31 - DX product training classes

More good news: for the three DevExpress product training classes that I announced earlier this month, I have extended the early-bird signup period to August 31 2010.

I got several emails from people who thought the period was a bit too short for their liking, seeing how it’s vacation time and their bosses aren’t there and so on… okay, I can see that. And since the dates are only in October, it seemed like a good move to give people more time.

In turn – all of you sign up, okay? :-)

Permalink 01:33:14 pm
Categories: .NET

Locations fixed for DXperience Silverlight and ASP.NET classes

Good news: the locations for both the DXperience Silverlight and the DXperience ASP.NET training classes that I have announced for later this year are now fixed.

(If you don’t know what DXperience is, but you are a .NET programmer, I suggest you go check out DevExpress’ brilliant component suites here!)

I got to say, it was easy to do them both at once, because they’re in the same place:

Hotel Zuiderduin is a place that has been recommended to me a long time before, but so far things have never worked out. John has been there and checked it out, and he assures me it’s brilliant! It’s not too far away from Amsterdam (their driving instructions have literally got three bullets only), which is always a draw!

I hope to see you at one of my classes!

06/07/10

Permalink 11:41:01 am
Categories: General

iPods and car stereos - any experts?

I’m wondering if somebody knows something about this that may help me. I have an iPod that I can hook up to the stereo in my car using a vendor supplied cradle (this is a Land Rover Discovery 3). This allows me to use the iPod itself to select the music I listen to, because the interface on the iPod stays active at all times.

In my caravan I have a car stereo installed as well, which has “iPod integration". Unfortunately the stereo runs pretty hot in the caravan when using it with MP3 CDs, so I like to use the iPod with it. The integration is through a special cable that comes from the back (I installed this myself, but I don’t recall exactly how it was hooked up – shouldn’t be that important, I guess), I think the stereo is JVC, but not totally sure.

Anyway, the problem is that this integration tries to control the iPod through the stereo itself. As soon as it’s plugged in, the iPod switches off its own interface and pressing its buttons doesn’t do anything. Unfortunately, the stereo itself isn’t very good at controlling the iPod – it’s a pain to select any particular music and simple features like skipping forward and backward by song seem to behave very oddly (not sure exactly what happens since I can’t see it on the display, but it doesn’t seem to do what I think it would).

Now, I guess there have to be different “modes” for hooking up the iPod to external equipment. I like it much better the way my in-car stereo does it, and I would like to have it that same way in the caravan. Is there a name for this “mode", so I could search for it and find stereos that work this way? Is there some other way I could make this work?

(I have considered hooking up the iPod through the audio connector only, but then it’s not going to be charged – currently, both my solutions charge the iPod while it’s hooked up.)

05/07/10

Permalink 02:01:32 pm
Categories: .NET

New DevExpress classes for WinForms, ASP.NET and Silverlight announced

I have just announced three new classes from my “Business Apps with DevExpress” series - Windows Forms, ASP.NET and Silverlight! You can find all the details here: http://www.oliversturm.com/dxtraining.html

Special early-bird pricing for all three classes is available until July 31st, so hurry and sign up!

25/06/10

Permalink 11:21:25 am
Categories: .NET

Relationships in XPO

I’m replying to a post in the DevExpress XPO forum, where the question came up of how to use joins with XPO/LINQ and projection. Unfortunately, the forum system mangled my code snippets, so I thought I’d put the info up here as well.


Emilio Garcia wrote:

I trying to create a linq query to retrive some objects, this is the query:

var
listadoSesiones = from u in usuariosjoin s in sesiones on u.ObjId equals
s.UsuarioIdwhere s.Activa == true
orderby s.FechaInicio ascending
select new { u.NombreUsuario, u.NombreCompleto, s.FechaInicio, s.FechaFin };

I’m pretty sure this doesn’t have anything to do with the Guid type.
Instead, the problem is the projection you’re trying to do. Instead, you
should define your classes correctly and things should be much easier…

I’m roughly translating your names, and I’m coming up with classes that
look like this:

Code:


public class User: XPObject {
  public User(Session session) : base(session) { }
 
  private string userName;
  public string UserName {
    get { return userName; }
    set { SetPropertyValue("UserName", ref userName, value); }
  }
 
  private string fullName;
  public string FullName {
    get { return fullName; }
    set { SetPropertyValue("FullName", ref fullName, value); }
  }
 
  [Association("User-Sessions")]
  public XPCollection Sessions {
    get { return GetCollection("Sessions"); }
  }
}
 
public class LoginSession: XPObject {
  public LoginSession(Session session) : base(session) { }
 
  private DateTime startTime;
  public DateTime StartTime {
    get { return startTime; }
    set { SetPropertyValue("StartTime", ref startTime, value); }
  }
 
  private DateTime endTime;
  public DateTime EndTime {
    get { return endTime; }
    set { SetPropertyValue("EndTime", ref endTime, value); }
  }
 
  private bool active;
  public bool Active {
    get { return active; }
    set { SetPropertyValue("Active", ref active, value); }
  }
 
  private User user;
  [Association("User-Sessions")]
  public User User {
    get { return user; }
    set { SetPropertyValue("User", ref user, value); }
  }
}

Note the two properties marked with [Association] - these are the ones
that implement the relationship for XPO. You should always set these
relationships up correctly, then it will be much easier to get to the
right data.

(As an aside - when working with legacy databases, you’ll sometimes need
to use the [Persistent(...)] attribute on properties like this to define
the name of the foreign key fields in your database.)

Once you’ve got your classes set up like this, you can easily query the
information you were looking for, utilizing these pre-configured
relationships:

Code:


using (UnitOfWork unitOfWork = new UnitOfWork( )) {
  var activeSessions =
    from s in new XPQuery&lt;LoginSession&gt;(unitOfWork)
    where s.Active
    orderby s.StartTime
    select new {
      s.User.UserName,
      s.User.FullName,
      s.StartTime,
      s.EndTime // why this? session is active, no end time...
    };
  foreach (var session in activeSessions)
    Console.WriteLine("Username: {0}, Full name: {1}, Start time: {2}",
      session.UserName, session.FullName, session.StartTime);
}

Of course on the other hand there’s no real need to do this either -
it’s so easy to get to the data you need through the relationship
properties, you don’t need to work with projection.

<< 1 ... 6 7 8 9 10 11 12 13 14 15 16 ... 105 >>

Enter your email address:

Search

Oliver
MVP logo
June 2013
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30