// I don't know the .NET syntax, but make a copy first with the upper-case conversion and do a test on the string String foo = mkvp.Key.ToUpperCase(); // And put each entry in an else..if block, that way you're not testing all conditions every time if (foo.equals("PRI_KEY")) groupMember.PrimaryKey = Convert.ToInt32(mkvp.Value); else if (foo.equals("FIRST")) groupMember.FirstName = mkvp.Value; else if (foo.equals("LAST")) groupMember.LastName = mkvp.Value; else if (foo.equals("GSTNO")) groupMember.GuestNo = Convert.ToInt64(mkvp.Value); else if (foo.equals("NOTES")) groupMember.Notes = mkvp.Value;