Code First From Database’ Template not showing in Visual Studio Entity Data Model Wizard

According to Microsft in this article is should see an option ‘Code First From Database’ when adding a new item to the project under ‘ADO.NET Entity Data Model’ in step 3. Where is it the component for Code First like following picture? For installing in Visual Studio 2012 or 2013 this functions you can download the install for this link https://www.microsoft.com/en-us/download/details.aspx?id=40762

Read More

Extract detail from barcode on bollettini prefilled (Italy)

  namespace PSC{ public class Bollettini { public bool getCode(string strCode) { bool rtn = true; if (strCode.Length != 50) { return false; } int first = Convert.ToInt16(strCode.Substring(0, 2)); Bollettino = strCode.Substring(2, first); int second = Convert.ToInt16(strCode.Substring(first + 2, 2)); Contocorrente = strCode.Substring(first + 4, second); int third = Convert.ToInt16(strCode.Substring(first + second + 4, 2)); string tmp = strCode.Substring(first + second + 6, third); Importo = Convert.ToDecimal(tmp) / 100; int fouth = Convert.ToInt16(strCode.Substring(first + second + third + 6, 1)); Codice = strCode.Substring(first + second + third + 7, fouth);…

Read More

ASP.NET MVC 4 and Entity Framework Database Migrations

ASP.NET MVC 4 was released in beta by the Microsoft ASP.NET MVC Developer Team and it comes with a number of really cool features: Bundling and Minification Support of CSS and JavaScript, Database Migrations using Entity Framework 4.3, Web APIs, Mobile Web with support for jQuery Mobile, Real Time Communication via SignalR, and Asynchronous Support. The Database Migrations using Entity Framework Code-First is really cool and is very much like Rails where you can change your code and then via Package Manager add migrations and update your database as your…

Read More

How to programmatically hide the keyboard

I have a textbox with a button inside. When the user presses the Action, a progress bas is displayed, the screen goes dark, and some magic happens. My problem is that since the action doesn’t result in the textbox losing focus, the on-screen keyboard is not hidden, and keeps covering half the screen. Just set focus to the main page: this.Focus(); this will focus a control that doesn’t use the keyboard and thus hide the keyboard. Unfortunately there is no API to the keyboard to hide it.

Read More

Blogger C# API

using System;using System.Text;using Google.GData.Client;using System.Net;using System.Xml;using System.Text.RegularExpressions;namespace BloggerDevSample{ class ConsoleSample { /** Lists the user’s blogs. */ static void ListUserBlogs(Service service) { Console.WriteLine(“\nRetrieving a list of blogs”); FeedQuery query = new FeedQuery(); // Retrieving a list of blogs query.Uri = new Uri(“https://www.blogger.com/feeds/default/blogs”); AtomFeed feed = null; feed = service.Query(query); foreach (AtomEntry entry in feed.Entries) { Console.WriteLine(” Blog title: ” + entry.Title.Text); } } /** Lists the user’s blogs and returns the URI for posting new entries * to the blog which the user selected. */ static Uri SelectUserBlog(Service service) {…

Read More

How to add a new Blogger post with labels from C#

First download and install Google API from here:https://code.google.com/p/google-gdata/downloads/list Add a reference to “Google Data API Core Library”,and use the following function: public static bool AddPost(string title, string bodyHTML, string[] labels) {     Service service = new Service(“blogger”, “<program name>”);     service.Credentials = new GDataCredentials(“<username>”, “<password>”);     AtomEntry newPost = new AtomEntry();     newPost.Title.Text = title;     newPost.Content = new AtomContent();     newPost.Content.Content = bodyHTML;     newPost.Content.Type = “html”;     foreach (string label in labels)     {         AtomCategory cat = new AtomCategory();         cat.Scheme = new Uri(“https://www.blogger.com/atom/ns#”);         cat.Term =…

Read More

Transparent Live Tile For Windows Phone 8.1

Windows Phone 8.1 Dev Preview Windows Phone 8.1 developer preview is totally awesome. So what is one of the most important things app devs can do right away, without much fuss, to make their apps look great with Windows Phone 8.1? Revisit your app’s Live Tile images. Why? In 8.1, Start screen is mesmerizing with the parallax effect and Live Tile with background overlay. Dev preview users are going crazy with new Start experience, and I am sure, with public release, end users are going to love to have background…

Read More

How to create and show an Icon on the Lock Screen in Windows Phone

This article demonstrates how to create / show a lock screen icon that will identify your Windows Phone 8 app on the lock screen. Here are a few quick steps you can follow: Step1. Create a new Windows Phone 8 application project in Visual Studio. Step2. Add a PNG image to your project, that will be displayed on the lock screen. Image requirements: Size: 38 x 38 Type: PNG Colors: The image must contain only white pixels, optionally  with some level of transparency Add a sample icon that meets the…

Read More

Live Tiles in Windows Phone 8: Part 1 Tile Templates

Live tiles are one of the signature features of Windows Phone and are used to represent your app on the start screen of the phone and give the user quick access to your app. Live tiles also enable apps to show notifications to the user on the home screen and starting with Windows Phone 8 – on the lock screen. While, the Primary (or default) tile appears on the phone’s start screen only when a user pins your application, secondary tiles are created programmatically by the application and multiple such…

Read More

Creating Custom Live Tiles for Windows Phone

Using Live Tiles in Windows Phone applications give new fresh way of communication with users. We can provide various information via Live Tiles to the user using text or images. This post will explain how to create custom live tiles with custom formatted text on the secondary tile using Flip template which is default Tile template. You can find more general info about Tiles on Tiles for Windows Phone MSDN page. Introduction When working with Live Tiles you provide default Tile images for Flip Template using WMAppManifest.xml file from Assets/Tiles folder:…

Read More

Windows Phone 8 : Background Agents – Periodic Agent

If you are a desktop or web developer, you are used to being able to decide when and where your code runs. On the phone you do not have that luxury, so you have to let the operating system dictate exactly when you run your application or some background operations. But how does the operating system handle background operations? Normally when you build a typical phone application, you submit a .xap file with all the code your application requires to launch the application’s user interface. Your application can be launched,…

Read More