eBarou - avocati online - online lawyers

December 9th, 2008

Soft Build ofera un nou serviciu dedicat avocatilor din Romania: eBarou.ro - avocati online. Inregistrand un cont, avocatii isi pot prezenta activitatea profesionala si pot fi mai usor gasiti de clienti.

Soft Build offers a new service dedicated to the lawyers in Romania: eBarou.ro - online lawyers. By registering an account, the lawyers can present their professional activity and can easily be found by their customers.

How to enable VSS over the Internet

August 19th, 2008

I found this great tutotial that I recommend: http://alinconstantin.homeip.net/webdocs/scc/VSS_Internet.htm

Using parameters for Ms Access query in VS query builder

July 31st, 2008

It is difficult to use a parameterized query in VS to get data from a mdb database. You usually have to use ? instead of the parameters, but if you want to use the parameter more than once (like in an iif function or something like that), then you should probably need to use the name of the parameter.

To make a long story short, just use [@name]. Notice both [] and @ signs.

Prop Res DLL not loaded

July 3rd, 2008

This is such a frustrating error, because it is generated by the Lexmark printer that you probabilly have. After googleing for a solution, you can try reinstalling Office, the Lexmark software, etc etc. Actually, this solution, taken from here should work:

goto c:\windows\system32\spool\drivers\w32×86\Lexmark_x1100_seriesf27b
and copy lxbkprpr.dll to c:\windows\system32

if you don’t have c:\windows\system32\spool\drivers\w32×86\Lexmark_x1100_seriesf27b
then just search for the dll.

This will resolve the issue.

And, another good advice from this guy:

Don’t buy lexmark printers cos lexmark don’t know what day it is.

Reading Application Settings

May 23rd, 2008

I wanted to use the connection string that was automatically generated, so I googled for a solution and I found this: System.Configuration.ConfigurationSettings.AppSettings[name of item].

Unfortunately, when building, you get “System.Configuration.ConfigurationSettings.AppSettings’ is obsolete”. This is because Microsoft has removed the AppSettings class from the System dll. The best solution I have found is here:

System.Configuration.ConfigurationManager. AppSettings[name of item]

And remember to add a reference to System.Configuration.dll.

Display decimals for a number

May 9th, 2008

The .ToString method has some wonderful features. If you want to display only 2 decimals for a number, you just have to display the format, like this: yourNumber.ToString(”N2″).

I found this solution on http://www.geekpedia.com/Question10_How-can-I-format-a-number-to-x-decimal-places.html. You can find there more formatting methods, in case you have some strict preferences.

Getting CodeIgniter to work with IIS

April 22nd, 2008

IIS is a bit scary, especially for people used to working with Apache. Still, if you use IIS and would like to work with the CodeIgniter framework, you just have to add a “?” in the config.php, next to “index.php” and it will work like a charm.

Just a note: I found this solution on http://codeigniter.com/forums/viewthread/71641/.

Setting the Culture for a Windows Application

April 16th, 2008

Some of the operating systems that we install our applications on, have the Regional Settings set to Romanian. So there can be problems with the numbers and date formatting. The best sollution is to set your application culture, no matter what the OS culture is:

using System.Threading;
using System.Globalization;
// Put the following code before InitializeComponent()
// Sets the culture
Thread.CurrentThread.CurrentCulture = new CultureInfo("ro-RO");
// Sets the UI culture
Thread.CurrentThread.CurrentUICulture = new CultureInfo("ro-RO");

The code is taken from http://msdn2.microsoft.com/en-us/library/b28bx3bh(VS.71).aspx.

Keeping only the date part in a datetime field inside MS SQL query

April 14th, 2008

Since I had to google this to find a good way to only use the datepart of a datetime field from my database, I tought you might use this:

convert(datetime,(convert(varchar (11),getDate())))

The source is on http://www.bennadel.com/blog/122-Getting-Only-the-Date-Part-of-a-Date-Time-Stamp-in-SQL-Server.htm, where you can find other smart ways to do it. I found this was the easyest for me.

Conversion failed when converting the varchar value ‘@parameter’ to data type int or something like this

April 11th, 2008

This is one of the most annoying errors that you now is easy to handle, but always have to google the sollution, because you don’t remember what you did last time to get rid of it.

Stop checking the C# code, the problem is not there. Just remove the quotes from the query string in the stored procedure and it will work just fine:).