Calender
<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

1.  Login to gmail and export contacts into vcf format.

2.  Open a cmd prompt and use the following command to push the file onto the SDCARD of the emulator

      - adb push contacts.vcf /sdcard/contacts.vcf

3.  Open the contacts application, hit the menu button and choose "import from sdcard" ... it should automatically pick up the vcf file.

 

 

Posted by: Jason | Created on: 06/07/2010, 17:57
If you're looking for a great way to help your kids learn, and have an iPhone or iPad, take a look at what KeyesKode has to offer. Check out his work! More information can be found here: http://www.roodev.com/keyeskode

Posted by: Jason | Created on: 06/07/2010, 17:46

I am using Sandcastle to generate my documentation, but I am also using Codesmith to generate all my DTOs.  When I try to generate documentation against the DTO library I get the following error:

SHFB: Error BE0065: BUILD FAILED: The imported project "C:\Program Files\MSBuild\CodeSmith\CodeSmith.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.  C:\projects\[dir]\[dir]\[dir]\my.project.file.csproj

The workaround is rather lame, but easily done.  I have to open the project file for the project that contains the CodeSmith generated content and remove the following line:

<Import Project="$(MSBuildExtensionsPath)\CodeSmith\CodeSmith.targets" />

 

Save it, and then rebuild your sandcastle project in the "Sandcastle Help File Builder GUI."

Don't forget to put that line BACK after you have generated your code.  Like I said, lame.

Ok now I'm not proud of this, but we all have funny business requirements that hit us sometimes and you do what you can to make "stuff" work.  I had an "emergency" come down from on-high and it was made clear that I had to implement a fix in production right away. I was told to avoid a recompile at all costs.  Aka they wanted me to change some text on an asp.net page but not touch the code-behind, which would require the recompile.

Unfortunately the requirement was that the text had to show up for only 1 item inside a repeater control.  The problem is you can't have conditions inside a binding expression.

You can tell just by looking at the following line how not-gonna-happen this is...

<%# if DirectCast(Container.DataItem, myFakeObject).ID = x then %>

Anyway ... IIF to the rescue, although this is horrid in every way .... here is the kludge.

<%# iif(DirectCast(Container.DataItem, myFakeObject).ID = x, "Some incredibly long html that outputs if the condition is true", " ") %>

In my case that html was an entire paragraph.  I'm not looking forward to hearing the screams of the developer that rolls up behind me and sees this.  Que Sara Sara.

 

 

Posted by: Jason | Created on: 23/02/2010, 00:42

I found myself in a situation where I had to get from a string forced upon me by a 3rd party web service into an property that is an enumeration on our side. 

That led me to look into how to loop through a enumeration in order to match on the string, but assign the value.

Basically i was getting “FAX” but I had to set a property = 2 because the enumeration was:

public enum ContactType : int

{

HOME = 0,

BUSINESS = 1,

FAX = 2,

}

 

For future reference here is how I accomplished this:

foreach (var contact in System.Enum.GetValues(typeof(ContactType)))
{
    if (contact.ToString() == phone.phoneType) //phone.PhoneType is a string, in this case it = “FAX”
    {
        phoneDTO.ContactType = (ContactType)System.Convert.ToInt16(contact);
    }

Here's one I will not probably remember the next time I need it.

A coworker was trying to use a DAL i generated in LLBLGen against a staging database on the same SQL Server as the production database the DAL was generated against.  If you look at the generated code you will see that the reference to the database is hardcoded. 

Turns out there is a way to tell LLBLGen to ingnore the hardcoded entry and use the catalog indicated in the connectionstring instead.

In your app.config or web.config file of your application project (not the llblgen project), add the following configuration:

<configSections>

     <section name="sqlServerCatalogNameOverwrites" type="System.Configuration.NameValueSectionHandler" />

</configSections>

<sqlServerCatalogNameOverwrites>

     <add key="myProdDB" value="" />

</sqlServerCatalogNameOverwrites>

In this example, the blank value (value = "") tells llblgen to just use whatever catalog is indicated in the connectionstring.  You could put the name of the new database in there and it will ALWAYS redirect to that database.

Additionally, Somewhere in your code that is calling your llblgen classes will need to include this line to set the connectionstring:

DbUtils.ActualConnectionString = "Data Source=mySQLServer;Initial Catalog=myDatabase_Staging;Persist Security Info=True;User ID=xxx;password=xxxxxxxxxx!"

Where myDatabase_Staging is the name of the database you want it to point to instead of the one you built your LLBLGen classes against.

Posted by: Jason | Created on: 11/01/2010, 22:27

I overloaded a method in my WCF service that compiled fine, but exploded in my face at runtime.   A bit of digging around later and I discovered you can get around this "limitation" by using the "name" attribute in your OperationContract tag of the ServiceContract.

Here is an example I found and the link to the original article where I found the answer:

[ServiceContract]
public interface ICalendarService
{
   [OperationContract(Name = "GetScheduledEventsByDate")]
   ScheduledEvent[] GetScheduledEvents(DateTime date);

   [OperationContract(Name = "GetScheduledEventsByDateRange")]
   ScheduledEvent[] GetScheduledEvents(DateTime start, DateTime end);
}

http://jeffbarnes.net/blog/post/2006/09/20/Overloading-Methods-in-WCF.aspx

 

I just stumbled on a nice "feature" that will have you scratching your head if you don't know it's there.  Apparently Microsoft changed the way the Async methods in a web service proxy get generated somewhere between VS 2003 and VS 2005.  

However, the project KNOWS if it's been "upgraded" from VS 2003 all the way to 2008 and generates the proxy with backward compatibility in place.  It wasn't until I started this rewrite and consumed the same web service that I noticed things MISSING from my proxy because, of course, this isn't an upgrade so they don't generate the old style async methods.

So here I was with my old and new solutions loaded side-by-side, regenerating the SAME web service reference and getting different results, and wondering ...  hhhhhhow?

So to be clear, BeginMyMethod and EndMyMethod style async methods are the "old" way and will not be generated until you  set a project level property WebReference_EnableLegacyEventingModel to be true.

Fortunately for me in this case, I can just abandon it and do it the 'new' way.

 

Here is the link to the article I found the answer on, though you will have to read through the comments a while to get there.

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=288660