Monday, 29 June 2009

How To Insert Single Quote Into DB2

June 29, 2009 1
If you try to insert single quote into DB2 sql table directly, it will give an error message due to single quote is reserved for mark a string value in sql. It is not allowed to use escape sequence for single quote with sql. Below example is incorrect with sql syntax.

INSERT INTO CUSTOMERS ( COMPANY_NAME ) VALUES ('Nandun\'s Company')

Here middle single quote is not valid even it has used the escape sequence. The easiest method to insert single quote into sql table is replace single quote with double quote.

INSERT INTO CUSTOMERS ( COMPANY_NAME ) VALUES ('Nandun\"s Company')

In second example I have replaced the single quote with double quote, but once you execute this command it will insert single quote instead of double quote.

You can use following code in C#.NET to replace single quote with double quote.

Replace("\'", "\"")

If you have any question you can list them under comments section.

Monday, 8 June 2009

Crystal Report Toolbar Images Not Displayed In ASP.NET

June 08, 2009 9
If you have used Crystal Report (Crystal Reports 2008 Official Guide) with Microsoft ASP.NET, you might have face this issue many times. This is a common problem with Crystal Report deployment and many people don't have proper solution for the problem. Crystal Report Toolbar images not shown in deployed environment is one of the main inconvenient with the tool that is leaded many developers not to use Crystal Report tool as their reporting tool even though Microsoft Visual Studio distribute Business Objects Crystal Report Tools free of charge. Even though your report is perfectly working inside the report viewer, it is not useful if the report viewers toolbar is not working properly. You can not navigate through multiple pages, can not export your report, can not print the report...etc. So that it is equally important to work your report and report viewer both correctly to feel end user happy reporting experience.

Thursday, 28 May 2009

Save Millions Of Dollars, Don't Pay For Graphic Tools

May 28, 2009 0

Are you a graphic designer, web designer or digital artists who is paying back most of your income for software tools that you are using for your creations? What will be your net income if you could save money that you are paying for those software tools? Yes, there are tons of free tools that you can use as alternative graphic software tool. Some of the free tools having rich set of functions than commercial tools, but most of the people are having lack of knowledge about them and their features. So, I decided to introduce few of them that I am using for my creations without paying any dollar for any company. That means cost for my creations are negligible and income is really high.

Sunday, 24 May 2009

No More Database Programming Needed !

May 24, 2009 2
Are you tired in writing complex code for your database design? Want to be little relax? This article will help you to enjoy your job.

In early days we had to write coding from the scratch to implement our database designs. Later people moved to database designing graphical tools. The latest trend of designing databases is use database navigation maps where you can visually feel your database design. This method is very useful if your database is little complex and you have lot of key constraints, referential integrity constraints, indexes and triggers etc. Using database navigation maps you can see either the entire database or part of it, how the tables are integrate each other, what are the keys you have defined for tables and references etc. Most importantly you don't need to write any single code or no need to remember complex SQL syntax.

Thursday, 21 May 2009

How To Validate XML Document With ASP.NET

May 21, 2009 0
In my previous article, we discussed on how to generate XML document or XML stream from your dataset. There I mentioned that one of the major advantage of converting a dataset into XML is we can easily validate our XML data against the XML schema. The XML schema is used to define the format, data types and key constraints that you want to validate. The XML document or XML stream can be validate against the predefined XML schema and exactly you can get the validation error and on which tag that error is occurred.

First you need to have a XML document to validate. There are several ways to convert your data into XML documents. In previous article I showed you one such method. In this article I will show you how to do a validation with XML schema for existing XML document.

Wednesday, 20 May 2009

Working With Dataset And XML In ASP.NET 2.0

May 20, 2009 0
XML data definition format is heavily used in nowadays applications since it is very rich data definition method. Working with XML data is very customizable, easy and reliable. Important features of XML language are;

  • well defined schema
  • purely character based data definition method
  • customizable tags
  • easy validation of XML documents
In ASP.NET it provides lot of shortcut methods to work with XML data. Actually .NET Frameworks most of the components fully based on XML languages. Few examples are Data Grid, Data Set and Class Designer etc. Due to this reason you can easily convert data in dataset to XML document and read data from XML document to feed into dataset. Why it is important to convert dataset into XML documents is a good question to analyze. There are few reasons to explain here, first thing is dataset is a kind of a special data format and not exchangeable with different applications. Transfer through web protocols is not straight forward with dataset, but XML data is based on characters and easily pass through the network. Most importantly validation of data is very easier with XML data that data in dataset. There are buit in validation functions with XML documents in ASP.NET.

Sunday, 17 May 2009

How To Specify Unique Key/Primary Key Constraints In DB2

May 17, 2009 0
Using iSeries Navigator you can very easily specify Unique Key and Primary Key for database table in DB2 database. Most of the people are not well aware that DB2 is relational database and it support all the relational database concepts. I have experience that most of the developers are not using key constraints, referential integrity, triggers etc. But most importantly DB2 is support for all these features. Let's look at one by one how these concepts can be implemented using iSeries Navigator on DB2 database.

To create Unique Key or Primary Key for a given table you need to go the table definition. Right click on the table that you want to modify and add new key and select "Definition" option.

Fig 1: Table Definition Option

Thursday, 14 May 2009

Crystal Reports in Microsoft Visual Studio 2005

May 14, 2009 0
With Microsoft Visual Studio 2005 you can develop applications with Crystal Reports without using separate Crystal Report application installed in the development machine. They have provided Crystal Reports tool in standard toolbox in Visual Studio 2005 environment. Simply you need to drag and drop these controllers and develop your reports same as previously with Crystal Report. Advantage is you don't need to buy separate Crystal Report application and install them in development and deployment environments.


Fig 1: Crystal Reports Tools in Microsoft Visual Studio 2005