Posts

While Loop and Variable Casting in SQL Script

Sometimes ago, I needed to insert bulk data to one of my table. I was needed a loop which will insert the data one by one. Previously I did that using a console application. But now I find a better solution using SQL Script. Below is the SQL I used. It is self explanatory. DECLARE @i int = 0 declare @suffix varchar (20) WHILE @i < 20 BEGIN     SET @i = @i + 1     set @suffix = CAST(@i AS varchar (20))     /* do some work */     INSERT INTO [dbo].[Customer]            ([FirstName]            ,[LastName]            ,[Phone]            ,[Email])      VALUES            ('F'+@suffix            ,'L'+@suffix            ,'Ph'+@suffix            ,'Em'+@suffix       ...

Windows store app development using javascript

Windows Store application development

Windows Store application development from Foyzul Karim

Dropbox as SVN Repository

Image
Version controlling is one of the most important concepts in software development. It helps us to maintain different version of files and folders in a very easy way among different peoples. One of the most popular versions controlling system is SVN.  This post is not about describing the features of SVN, rather it will focus some advanced issues here. The most critical (and important) problem I faced while working in online distributed team is to maintain the codes among my different team mates. Well, there are many free online SVN servers out there which will provide you space to store your SVN repository, but there is another way you can bypass those SVN server if you don’t want to put your code on their servers. Below are the steps. 1. Setup environment Download  TortoiseSVN  and install. 2. Create folder 2.1 Go to your Dropbox folder and create a new folder named 'DropboxSvnRepository' 3. Create repository 3.1 Right click on the ...

Code Smells

Software Design Principles

1st Get together of Android Developers of Bangladesh

Last 24th March, 2012, we, some of the members of Android Developers of Bangladesh Facebook group attended a get together in BASIS Class room. There, Ahsanul Karim, Shafiul Hasan and I presented some slides. Those slides can be viewed from below or can be downloaded. Shafiul Hasan's Presentation Foyzul Karim's Presentation

Javascript Basics : Part 2 (Functions)

Image
Suppose I want to change the button color when it is clicked. And to do this task, I don’t want to send the page to the server. So, what should I do? Well, HTML DOM has given us some events to work with. We will use one the events, Click event and put some code on its event. The below code will change the button color if clicked on that. Now, if we want to add another button and apply same functionality with the click, the code will like below But if you look closely, we are repeating the code. This is the worst smell of the code smells . So, we should create a method and call that method from the click event. So, how do we create a function in Javascript? Its easy. As we did before, we must add the ‘script’ tag first. Inside of this tag, we will write the function. In javascript, we must write the word ‘function’ before the name of the function. For example: function MyFunctionName() { } Then we will call that function from the event. So, if we refac...

Javascript Basics : Part 1 (Hello world)

Image
Now a days, the most basic thing a web application developer must know is Javascript. So, what is javascript? Yes..you probably know Javascript is nothing to do with Java. Javascript is totally different with Java. In syntax, in semantic, in usage, in all aspects. So, Javascript is a scripting language which runs in browser. The browser software executes the script line by line, from top to bottom, and display you the output. Now what you can guess, Javascript must be embedded in a HTML file and when the HTML codes are rendered/executed, Javascript codes get executed with those. If you want to let your browser know that you are writing a Javascript code, you must add some extra tags/codes with the statements. For example: What you can see, at the above code, by the ‘document.write’ method, we are writing some text in the browser. But we need to add the 'script' tag having the type as javascript with it. If the browser executes this line of code, we can view ‘ Javascri...

LINQ - The beginning

Can not load 'crdb_adoplus.dll' solved by useLegacyV2RuntimeActivationPolicy

Image
In one of my current project, I am using visual studio 2010. I need to show report for some features. Well, everything was going smoothly before i installed my Windows 7 again in last week. after installing visual studio 2010, I installed the crystal report executables provided by BusinessObjects . then i ran my project and tried to open the report. But unfortunately it was showing the following error "Could not load file or assembly 'file:///C:\Program files (x86)\Sap BusinessObjects\Crystal Reports For .Net Framework 4.0\Commom\Sap BusinessObjects Enterprise XI4.0\win32_x86\dotnet1\crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified." In enlarged mode: I have searched and found a solution. I just needed to put the useLegacyV2RuntimeActivationPolicy="true" into the          tag under tag.  And guess what? The report is not displaying like below: I am not sure why it is happening. I will write ...

How to change the Database Connection of LINQ to SQL Class

Image
Introduction Its very common that couple of developers are working on a single project. Me and one of my friend are also working on a .NET project. We are using LINQ to SQL class to query on the database. This is a desktop Windows Form project and we are maintaining our code as dumbest way possible. That is, when i update on any part, i just mail him the file and he replaces the file. So far so good. Problem statement But when I sent him my project, he couldn't run the database queries. Because the connection string embed on the DataContext.dbml class was not changed. He couldn't find a good way to change the connection string value. So I was searching for a better solution, and at last I found it today. Solution 1. Double click on the DBML file of your project.   2. Now right click on the work area of the DBML file (Start sign in the image) 3. Expand the connection property and check the Data Source value. in my case, it is 'Magicbox' since it is my machin...