Skip to main content

CODING

C# - Wrap Label Text

One of the issues with label in windows forms programming is if you set the label to AutoSize, it will automatically grow with whatever text you put in it.

If you want to make it word wrap at a particular width, you can set the MaximumSize propery.

label.MaximumSize = new Size(50, 0);

label.AutoSize = true;

If you have the label snap into it's container, you can switch off AutoSize, leave the max size property as it is, and it will word-wrap exactly as we want.

How to Join Variables in Bash Script

Every advanced GNU/Linux user uses Bash scripts to make life easier.

We maintenance a lot of websites, hosted mostly on LAMP systems (Linux, Apache, MySQL, PHP). Tasks could be time consuming if you have so many sites, so creating scripts to done jobs instead of you is very useful.

MySQL Tips and Tricks

Inforbiro is an Information Technology and Marketing Agency with its own Internet marketing network BlicKlik. We have a lot of experience in software development as well as in Internet marketing and advertising. We constantly try not only to develop great web sites, mobile, desktop or facebook applications but also to share our knowledge.

MySQL can't specify target table for update in FROM clause

If you are a developer or DB administrator it's a common situation that you need to update MySQL table , for example to set user statuses depending on Id column.

Let's say that we need to unvalidate users with Id < 100. If you try to run the following query:

update Users set Valid = 0
where Id in (
  select Id from Users where Id < 100
)

You'll get the error message:

#1093 - You can't specify target table 'xxx' for update in FROM clause

SQL Server - Collation Conflict

Collation conflicts in SQL Server

If you try to compare values or insert new records into a table from another table from another database with different collation you could get some of the following errors:

"Cannot resolve the collation conflict between "SQL_Latin1_General_CP1250_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation."

"Cannot resolve collation conflict for equal to operation."