Tuesday, February 12, 2008

Catalog name overwriting (SqlServer)

For generated code by llblgen Tool, it can sometimes be necessary to use the generated code with a catalog with a different name than the catalog the project was created with. As LLBLGen Tool generates the catalog name into the code, it might be necessary to specify a way to rename the catalog name in the generated code at runtime with a given name. LLBLGen Pro supports multiple catalogs per project, so you can specify more than one rename definition.LLBLGen Tool offers a way to rename multiple catalogs in one go. The renamed data is stored in static hashtables which assure that the Dynamic Query Engines (DQE) for SqlServer and Sybase ASE use the right catalog names without losing any performance.

To setup the renaming of catalogs, follow these steps.

1: In the configuration tag in the .config file has to be the configSections tag. In there, place a section definition tag as shown in the example below:

ionHandler" />


2: Set New Catalog Name

Note :

For ASP.NET applications, the section declaration has to contain in the type attribute the full type with version and culture, otherwise you'll get an exception at runtime. The specific type declaration is specific for the .NET version you're using and you can find examples how to specify it from the

machine.config file in %WINDIR%\Microsoft.NET\Framework\version \CONFIG.

For example for .NET 1.1, SqlServer specific:

FileSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a

5c561934e089" />

Monday, February 11, 2008

Microsoft Going open source for dotnet framework library??

Andy Mulholland posted about this important piece of information, which I think will be very significant for .NET programmers and also for the world at large:
.NET Framework Library Source Code now available
you’ll be able to dynamically load the debug symbols for .NET Framework libraries and step into the source code. VS 2008 will download both the symbols and source files on demand from the MSDN reference servers as you debug throughout the framework code.
This is a very different move from the usual MS strategy of keeping the code to themselves.
think that enabling source code access and debugger integration of the .NET Framework libraries is going to be really valuable for .NET developers. Being able to step through and review the source should provide much better insight into how the .NET Framework libraries are implemented, and in turn enable you to build better applications and make even better use of them.
I would like you all to comment out on this one as it is a significant developement in the future of dotnet technologies.

EXTJs Showcase

Must see this amazing demo from EXTJS. Very clean and nicely done.

Showcase2 Application

Sunday, February 10, 2008

How to convert AMR file to WAV file

Use this, to convert AMR file to WAV file

Mobile AMR Converter uses Sony Ericsson AMR converter to convert WAVE files (*.wav) to AMR (Adaptive Multi-Rate Codec, *.amr) and vice-versa. The program is very easy to use.

1) Launch Mobile AMR Converter.
2) Click on AMR to WAVE light button (below green picture: phone to PC).
3) Next, specify your input AMR filename: click on the first Browse light-button, select your amr file and click OK.
4) Click Convert .

http://www.hdmail.co.uk/MobAmrCon14-setup.zip

Going crazy with iPhone


Software: PocketGuitar Lets You Kick Out Riffs With Your iPhone

I am going crazy thinking how COOOOOL this is. I don't hold an iphone right now but wish I had one here.

If someone tried this one, please tell me how good it is???

Green Tip of the Day!!

Most of us in the IT field, used to do one thing before leaving for the day from office,
Press Ctrl+Alt+ Del and leave to home happily. That means your PC is still on..
One normal PC in the sleeping mode (Hibernation) will consume 35 watts/hr.
Based on this we will do a small calculation.
For one week 24 * 7 = 168 Hrs
Of this if we consider that we are working for 68 hours, then
the PC is in sleeping mode for 100 Hrs a week. For one month 4 * 100 = 400 Hrs
In a normal IT office, if we assume approximately 250 PCs are there,
250 * 400 = 1,00,000 Hrs (Sleeping Mode)
So the power wasted in an office in a month is,
100000 * 35 = 3500 KWH or units.
If the charge per unit is Indian Rs. 6, then totally the wastage value is approximately 21000 Indian rupees.

Here the sad thing is not the money loss to the company but the power loss to the country. (Hope no company is bothered about this procedure of keeping the system in sleeping mode)

Apart from the loss to the country we need to think of the efforts people are putting for producing the power in the Mines, Thermal Stations, Hydro electric Stations, etc. If this is to continue, the cost of unit power will go up & at one stage we will not get power even if we are ready to pay any cost.
So before leaving to home take some time to shut down the PC and do some favour to the country and the organisation.
If you feel that this point is to be considered forward this to all your friends.

*** Do it once it will become a Habit... Good Habit... be a good citizen of India.....

Saturday, February 9, 2008

Syntax to Call API through C# code

[DllImport("advapi32.dll", CharSet = CharSet.Unicode, EntryPoint = "RegQueryValueExW", SetLastError = true)]
static extern int RegQueryValueEx(
IntPtr hKey,
string lpValueName,
int lpReserved,
out uint lpType,
System.Text.StringBuilder lpData,
ref uint lpcbData);

Syntex to use:

uint pvSize = 1024;
System.Text.StringBuilder pvData = new System.Text.StringBuilder(1024);
uint pdwType = 0;
int success = RegQueryValueEx(regKey, "AKeyName", 0, out pdwType, pvData, ref pvSize);


[DllImport("advapi32.dll", SetLastError=true)]
static extern int RegCloseKey(
IntPtr hKey);
Syntex to use:

Microsoft.Win32.RegistryKey.Close() Method.


DllImport("advapi32.dll", SetLastError=true)]
static extern int RegCreateKeyEx(
int hKey,
string lpSubKey,
int Reserved,
string lpClass,
RegOption dwOptions,
RegSAM samDesired,
SECURITY_ATTRIBUTES lpSecurityAttributes,
out int phkResult,
out RegResult lpdwDisposition);


[Flags]
public enum RegOption
{
NonVolatile = 0x0,
Volatile = 0x1,
CreateLink = 0x2,
BackupRestore = 0x4,
OpenLink = 0x8
}

[Flags]
public enum RegSAM
{
QueryValue = 0x0001,
SetValue = 0x0002,
CreateSubKey = 0x0004,
EnumerateSubKeys = 0x0008,
Notify = 0x0010,
CreateLink = 0x0020,
WOW64_32Key = 0x0200,
WOW64_64Key = 0x0100,
WOW64_Res = 0x0300,
Read = 0x00020019,
Write = 0x00020006,
Execute = 0x00020019,
AllAccess = 0x000f003f
}

public enum RegResult
{
CreatedNewKey = 0x00000001,
OpenedExistingKey = 0x00000002
}

use :-

Microsoft.Win32.RegistryKey.CreateSubKey


[DllImport("advapi32.dll", SetLastError = true)]
static extern int RegSetValueEx(
IntPtr hKey,
[MarshalAs(UnmanagedType.LPStr)] string lpValueName,
int Reserved,
Microsoft.Win32.RegistryValueKind dwType,
[MarshalAs(UnmanagedType.LPStr)] string lpData,
int cbData);

use it :-
My.Computer.Registry.SetValue(KeyName, valueName, value, valueKind)
with signature:
keyName As String
valueName As String
value As Object
valueKind as RegistryValueKind

http://pinvoke.net/default.aspx/advapi32.RegSetValueEx#