Tuesday, July 26, 2011

SQLite management tool.

SQLite have lots of management tools, some of them are open source and some of them are trial ware and some of them are commercial. I found “SQLite Administrator” Pretty easy to use and handy tool as far as SQLite database file is concern.

A complete list of SQLite management tools can be found here “http://sqlite.com/cvstrac/wiki?p=ManagementTools” download the use what ever best suits you.

Today I am going to talk about only in SQLite Administrator, It can be downloaded from the following site.

http://sqliteadmin.orbmu2k.de/

A Complete list of feature is given In that site.

image

Features:

  • Create / Modify / Delete Tables by Wizard
  • Create / Modify / Delete Indices by Wizard
  • Create / Modify / Delete Views by Wizard
  • Create / Modify / Delete Triggers by Wizard
  • SQL Code Completion that supports table aliases
  • SQL Code Highlighting
  • SQL Error Locating
  • Import Data from CSV Files
  • Export Data ( XLS / CSV / HTML / XML )
  • Store User Queries into Database
  • Search for User Queries
  • Store Images into Blob Fields ( JPG / BMP )
  • Show SQL of each Database Item
  • Migrate SQLite2 Databases to SQLite3
  • Try to keep Indices and Triggers after modifying a Table

 

Note

This tool need no installations what so ever. The whole package is in a zip file and need zero installation, just unzip and open the exe that’s it, and All of the functionality is pretty easy and it has very intuitive UI. I would recommend it to every one who work with SQLite.

Using SQLite in Visual Studio 2010

Introduction

Every now and then we need a simple database solution which is light, small and pretty easy to use. What more can be useful other than SQLite, A simple yet very powerful tool to support database for any kind of application needs. When we started this research work we had a particular focus to choose right kind of database depending on few criteria.

  • We don’t want to use a service based database rather a file system based database.
  • Client have to be light, fast and support blob data.
  • We don’t want to install any client or framework in client machine

 

Background

After few minutes of research in the internet we came up with few embedded file system database that can be used in .net and has support, necessary tool and provider.

  1. SQLite
  2. SQL Compact Database
  3. Firebird

Among those SQL Compact DB is really have good support with visual studio IDE and very easy to use but it has its own limitations and we would definitely discuss in future about it. But the end result was that we found that SQLite is winner in every case and that’s why we choose to recommend it in this short article.

Adding the provider

Change Data Source

Next step is to add a data connection in server explorer in Visual studio 2010. When you click on add connection by default you don’t have provider added in visual studio, so we have to add it using a third-party tool. You can download the provider for SQLite from http://sqlite.phxsoftware.com/ site. “SQLite-1.0.66.0-setup” this is the version we used for this particular case. When you install this provider you would be given an option to integrate this in vs2008 and vs2010.

Installing the provider

After installing the provider when you get back to the add data connection in server explorer you would see an new provider is available for SQLite.

Adding the connection is Server Explorer

SQLite Provider

Go ahead and click on after choosing SQLite Database File. Next we will be presented with a screen where you would either choose an existing database or created a new database file.

Create New SQLLite DB

That’s it your connection string and database connection is set up and you are good to go with design of the database. Few interesting note on this particular case. My SQL database have no database diagram support yet. But we hope that this will be provided soon. After adding connection we can created tables and add necessary relations to the table.

Conclusion

In this short article we have seen that how easily SQLite can be used in visual studio 2010 using a provider to create connection in server explorer. Next we would discuss how to use SQL Lite to create a data layer using Entity Framework.

Update

New article with new provider by SQLite org is published here http://munnaondotnet.blogspot.com/2012/06/using-sqlite-in-visual-studio-2010-with.html

Friday, June 10, 2011

BCL : PDF converter and sdk for easy use.

Hi recently we developed a Silverlight component for one of our client and used some very interesting technologies. I thought those are worth sharing. If you are thinking about converting your PDF document to word or some other format I would suggest you use BCL component. You can download the sdk as well as the trial software from http://www.pdfonline.com/.

image

There could be lots of technologies for converting documents from one format to another but sad thing is noting is free. You have to pay to use this component so some financial bottleneck is involved. I would very much like to see some free component in future. In those cases open source software's would have had those rich conversion facilities.

image

Until we find free products for conversion, this is a good choice.

Friday, June 3, 2011

Double dependency property causing exception!

background

Hi , today I am going to share a small tips, its about dependency property, here is what I added in my presenter, looks like a innocent dependency property to me.

CenterX DependencyProperty

public double CenterX
{
get { return (double)GetValue(CenterXProperty); }
set { SetValue(CenterXProperty, value); }
}

public static readonly DependencyProperty CenterXProperty =
DependencyProperty.Register("CenterX", typeof(double),
typeof(MainWindowPresenter), new UIPropertyMetadata(0));



In first thought I found not problem in this code, but when I run the code end up with a the following exception,


image


In fact I didn’t now that it happen because of the dependency property, I was banging my head on the wall for few minutes when I saw this exception window. I commended lots of code that I wrote since the last commit and successful run. And when I start commenting one by one code segment, and finally found out that dependency property.


The want’s wrong with it?


It took a while to figure out what is wrong with it, I have rewritten the property with a minor change, can you see what is changed in the following code?


public double CenterX
{
get { return (double)GetValue(CenterXProperty); }
set { SetValue(CenterXProperty, value); }
}

public static readonly DependencyProperty CenterXProperty =
DependencyProperty.Register("CenterX", typeof(double),
typeof(MainWindowPresenter), new UIPropertyMetadata(0d));


Yes a simple change first time it was 0 how 0d on UIPropertyMetaData. Yes this is a simple change but took a while to figure it out.


Hope you wont loss you time with this kind of mistake, always use 0d or some (doublevalue)d when initializing a double dependency property.


Until next time bye bye.

Thursday, May 5, 2011

Balsamiq: Another mockup building tool for all kind of purpose.

Today I am going to share yet another mockup building tool with you guys. Before going in to more discussion, can you recall any good mockup tool free, i.e. either freeware or shareware three year back. We used Microsoft Visio for a long time. Until our designers made up there mind to do all sort of mockup using Photoshop. Again considering the price of the tool Photoshop was a good choice as it serve multiple purpose for the designers.

The tool or component that I want to share with you guys is Balsamiq. It is yet another mockup building tool and I must say a very good one. I have already talking about mockupbuilder.com where a silverlight component do all the thing for mockup. Here we can say that it’s a competitor for the mocupbuilder.com, Balsamiq is designed and developed via flex(Perhaps) and has runtime framework as adobe Air.

Its free if you use this by lunching from there site, and you can also buy the commercial version with $79 for a single license. Till now our designers are using this free version and They are pretty happy about it.

image

On thing I must mention here that not only designers are comfortable with it, stake holders like developers and product owners even customers understand the simple sketch like drawing. As our project manager said

“Even though the name sounds funny but the tool is awesome and we are liking it”

Until next time me signing our.

Between Extension method for double

This is a work in progress and can be used for only numeric data types. And also works with all the object that implements IComparable.

Works for almost every case and it is pretty handily.

/// <summary>
/// Extention method for between
/// </summary>
public static class SomeExtention
{
public static bool Between<T>(this T actual, T lower, T upper) where T : IComparable<T>
{
return actual.CompareTo(lower) >= 0 && actual.CompareTo(upper) <= 0;
}
}


Looking forward to share more about this stuff. Until next time bye bye.