0

Fix “Unable to convert MySQL date/time value to System.DateTime” exception when using MySQL .NET Connector

Posted by Nantharupan on 2:08 AM in , ,
Recently I developed a WPF MVVM application using MySQL as database. I faced a lot of problems!

One Issues i faced was when i retrieve the data from data base using linq i am getting exception  "Unable to convert MySQL date/time value to System.DateTime". When i checked the data has empty /0000-00-00  as date. When i checked in the internet i found the solution. 

Fix one Change or fix the Dates to a correct date.

Fix Two 

add the following property to connection string 

convert zero datetime=True;

You can set this when you connect to the data base as well. You have to click advanced and make the "convert zero datetime" property true;



1

Page Navigation in WPF MVVM

Posted by Nantharupan on 3:02 AM in , ,
When i tried to follow MVVM architecture in WPF, i faced the challenge of how to do Navigation to pages in Frame. finally i figured it out in the internet.

You need to have  a navigator class like following,



In your App.xml.cs file under the OnStartup method put the following code





Now you can call any pages in the ViewModel like the code follows


Happy Coding



0

Stop Phone Gap Android Application Crash when orientation Changes

Posted by Nantharupan on 9:57 PM in , ,
Problem

PhoneGap Android Application crashes when orientation changes

Solution 

Some changes need to be done in the AndroidMainfest.xml file 

Put the following to the Main activity or all the activity you have

android:configChanges="orientation|screenSize|keyboardHidden" 





0

Fixing Header and Footer & Scroll able Content

Posted by Nantharupan on 10:18 PM in , ,
Today i found a simple way to fix the Header and Footer of the HTML page to top and bottom respectively and make the content scroll able, it will be useful when we have list of items and fixed header & footer in mobile applications. 

Here is the HTML you have to use






Here is the CSS you have to use.





0

Mobile Application Development Introduction

Posted by Nantharupan on 2:57 AM
Following is the slide show i prepared for a talk in my company!!! Its talks about Mobile application development introduction level.



0

How to post Code in Blogger

Posted by Nantharupan on 3:45 AM
I have been searching in the internet to find a way of posting the codes in blogger. interestingly there are many ways to do that.  This post shows one way of posting the code. I will explain other ways in coming posts.

Step One : Go to https://gist.github.com/

Step Two : Enter description ( Its optional)
Step Three : Add a File Name
Step Four : Enter the code to be posted in the blogger
Step Five : Click the Create Public Gist
Step Six : Click the Embed and copy the code generated
Step Seven : Paste the code where u want to show the code. 

One example of the out come below.



0

HTML5 Storage

Posted by Nantharupan on 11:12 PM in ,
HTML5 Storage

HTML5 included two mechanism to store user data in client side. 


  1. session storage
  2. local storage

Session Storage

The session storage is designed for scenarios where the user is carrying out a single transaction, but could be carrying out multiple transaction in different window at the same time.
  • How to store the values
<script type="text/javascript">
sessionStorage.star = 1;
</script>
  • How to retrieve the values
<script type="text/javascript">
document.write("Total star Earned " +sessionStorage.star);
</script>

  • How to clear sessionstorage
    • Session storage will be cleared when browser closed
Local Storage

The Local Storage is designed for storage that spans multiple windows and lasts beyond the current session.
  • How to store the values
<script type="text/javascript">
localStorage.star = 1;
</script>

  • How to retrieve the values
<script type="text/javascript">
document.write("Total star Earned " + localStorage .star);
</script>
  • How to clear localStorage
localstorage.clear(); will clear all local storage;
or
localStorage.remove("key"); will remove particular key
<script type="text/javascript">
localStorage.clear();
</script>

Popular posts

Copyright © 2009 On the way All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.