- mm/dd/yy
- mm/dd/yyyy
- dd.mon.yyy
Friday, July 30, 2010
SQL Server Date Formats
There are several date formats available in the SQL like the following few formats
Wednesday, July 21, 2010
Download .dll or .exe files from IIS server.
If try to download he exe or dll file from the IIS server, you will get 404 file error. But this is incorrect settings in the IIS.
Why:
IIS Manager >> Website/VD >> Properties >> Home Directory >> Application Settings
Execute permissions set to "Scripts and Executables" in IIS.
Resolution:
IIS Manager >> Website/VD >> Properties >> Home Directory >> Application Settings
Set Execute permissions to "Scripts only" in IIS.
Why:
IIS Manager >> Website/VD >> Properties >> Home Directory >> Application Settings
Execute permissions set to "Scripts and Executables" in IIS.
Resolution:
IIS Manager >> Website/VD >> Properties >> Home Directory >> Application Settings
Set Execute permissions to "Scripts only" in IIS.
Friday, June 18, 2010
Microsoft Cursor Engine error '80004005'
When you are trying to retirve data from oracle database from classic ASP. You will get the bellow error.
Microsoft Cursor Engine error '80004005'
Data provider or other service returned an E_FAIL status.
/localhost/file.asp, line 68
For this you need to add NVL function for the null value column
Microsoft Cursor Engine error '80004005'
Data provider or other service returned an E_FAIL status.
/localhost/file.asp, line 68
For this you need to add NVL function for the null value column
Data provider or other service returned an E_FAIL status.
When you are trying to retirve data from oracle database from classic ASP. You will get the bellow error.
Microsoft Cursor Engine error '80004005'
Data provider or other service returned an E_FAIL status.
/localhost/file.asp, line 68
For this you need to add NVL function for the null value column
Microsoft Cursor Engine error '80004005'
Data provider or other service returned an E_FAIL status.
/localhost/file.asp, line 68
For this you need to add NVL function for the null value column
Friday, June 11, 2010
Execute exe files through javascript
Before running the bellow script, you need to midify the setting of the internet explorer
- Open IE
- Click Tools -> Internet options
- Click security Tab
- Select local intranet (Based on your requirement)
- Click Custom level button
- find "Initialize and script ActiveX controls not marked as safe for scripting"
- Click the enable button
- Click "Ok"
- Click "OK"
- Close your browser and re-open to test it
function executeCommands()
{
var oShell = new ActiveXObject("Shell.Application");
var commandtoRun = "iexplore.exe";
oShell.ShellExecute(commandtoRun, "", "", "open", "1");
}
Tuesday, May 25, 2010
Oracle output on HTML file
SET MARKUP HTML ON SPOOL ON HEAD "<TITLE>SQL*Plus Report</title> -
<STYLE TYPE='TEXT/CSS'><!--BODY {background: ffffc6} --></STYLE>"
SET ECHO OFF
SPOOL employee.htm
SELECT sysdate from dual;
BY modified_date ASC;
SPOOL OFF
SET MARKUP HTML OFF
SET ECHO ON
Monday, May 17, 2010
Forgot to mention subject in mail???
- Open your Outlook,
- Press Alt+F11. This opens the Visual Basic Editor and then Press Ctrl+R which in turn open Project-Project 1 (left side)
- On the Left Pane, one can see "Microsoft Outlook Objects" or "Project1", expand this. Now one can see the "ThisOutLookSession".
- Double click on "ThisOutLookSession". It will open up a Code Pane on the right hand side.
- Copy and Paste the following code in the right pane (Code Pane) and save
it Private Sub Application_ItemSend(ByVal Item As Object,
Cancel As Boolean)
Dim strSubject As String
strSubject = Item.Subject
If Len(Trim(strSubject)) = 0 Then
Prompt$ = "Subject
is Empty. Are you sure you want to send the Mail?"
If MsgBox(Prompt$,
vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check for Subject") = vbNo Then
Cancel = True
End If
End If
End Sub
Wednesday, May 5, 2010
Run Commands
Infrequently Used Run Commands
Below are a list of commands you can type into the Run dialog, split into several categories: programs, control panels, computer administration tools, and special folders.Programs
| Character Map | charmap |
| Check Disk Utility | chkdsk |
| Clipboard Viewer | clipbrd |
| Free Cell | freecell |
| Hearts Card | mshearts |
| Microsoft Chat | winchat |
| Minesweeper | winmine |
| On Screen Keyboard | osk |
| Remote Desktop | mstsc |
| Spider Solitare | spider |
| Telnet Client | telnet |
| Windows Magnifier | magnify |
Control Panels
| Accessibility Controls | access.cpl |
| Add Hardware Wizard | hdwwiz.cpl |
| Add/Remove Programs | appwiz.cpl |
| Administrative Tools | control admintools |
| Automatic Updates | wuaucpl.cpl |
| Date and Time | timedate.cpl |
| Display Properties | desk.cpl |
| Folders Properties | control folders |
| Fonts | control fonts |
| Fonts Folder | fonts |
| Game Controllers | joy.cpl |
| Internet Properties | inetcpl.cpl |
| Keyboard Properties | control keyboard |
| Mouse Properties | control mouse |
| Network Connections | control netconnections |
| Network Setup Wizard | netsetup.cpl |
| ODBC Data Source Administrator | odbccp32.cpl |
| Password Properties | password.cpl |
| Phone and Modem Options | telephon.cpl |
| Power Configuration | powercfg.cpl |
| Printers and Faxes | control printers |
| Printers Folder | printers |
| Regional Settings | intl.cpl |
| Scanners and Cameras | sticpl.cpl |
| Security Center | wscui.cpl |
| Sounds and Audio | mmsys.cpl |
| User Account Management | nusrmgr.cpl |
| Windows Firewall | firewall.cpl |
Computer Administration Tools
| Computer Management | compmgmt.msc |
| Device Manager | devmgmt.msc |
| Disk Cleanup Utility | cleanmgr |
| Disk Defragment | dfrg.msc |
| Disk Management | diskmgmt.msc |
| Disk Partition Manager | diskpart |
| Dr. Watson System Troubleshooting | drwtsn32 |
| Driver Verifier Utility | verifier |
| Event Viewer | eventvwr.msc |
| Group Policy Editor (XP Prof) | gpedit.msc |
| Local Security Settings | secpol.msc |
| Local Users and Groups | lusrmgr.msc |
| Performance Monitor | perfmon |
| Resultant Set of Policy | rsop.msc |
| Scheduled Tasks | control schedtasks |
| Services | services.msc |
| Shared Folders | fsmgmt.msc |
| System Configuration Editor | sysedit |
| System Configuration Utility | msconfig |
| Utility Manager | utilman |
| Windows System Security Tool | syskey |
Computer Administration Tools
| Application Data Folder | %appdata% |
| Home Directory Drive | %homedrive% |
| Home Directory | %homepath% |
| Shared Home Directory | %homeshare% |
| Temporary Folder | %temp% |
| Windows Root Drive | %systemdrive% |
| Windows Root Directory | %windir% |
Creating Your Own Run Commands
- Win+R to open the Run dialog
- Enter %windir% to open the Windows directory
- Create a shortcut to the desired program
- The name you give the shortcut is what you type in the Run dialog to start the program
Thursday, April 29, 2010
Image Opacity
.hovereffect img {
opacity:0.5;
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);
-moz-opacity:0.5;
-khtml-opacity:0.5;
}
.hovereffect:hover img {
opacity:1.0;
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);
-moz-opacity:1.0;
-khtml-opacity:1;
}
From : vandhemadharam
Wednesday, April 28, 2010
Thursday, January 7, 2010
How to use Reserved Words in .NET (C#)
If you can use tens and thousands of words as identifier, why should one use the few keywords reserved by C#?
A reserved word for the C# language was found where an identifier was expected. Replace the keyword with a user-specified identifier.
To overcome this error, prefix the identifier with “@”. The character @ is not actually part of the identifier, so the identifier might be seen in other languages as a normal identifier, without the prefix. An identifier with an @ prefix is called a verbatim identifier.
private static void KeywordExample()
{
string string = "Some String";
}
Might be you still want to use ‘bool’, ‘string’ etc. But using this will throw “identifier expected, 'keyword' is a keyword - Compiler Error CS1041” A reserved word for the C# language was found where an identifier was expected. Replace the keyword with a user-specified identifier.
To overcome this error, prefix the identifier with “@”. The character @ is not actually part of the identifier, so the identifier might be seen in other languages as a normal identifier, without the prefix. An identifier with an @ prefix is called a verbatim identifier.
private static void KeywordExample()
{
string @string = "Some String";
Console.Write(@string);
}
Check Multiple Instances of an Application using C#
Simple code to check if multiple instances of current application are running in the machine using System.Diagnostics
private static void check_application_process_instances()
{
Process[] oProcess;
String sModuleName;
String sProcessName;
sModuleName = Process.GetCurrentProcess().MainModule.ModuleName;
sProcessName = System.IO.Path.GetFileNameWithoutExtension(sModuleName);
oProcess = Process.GetProcessesByName(sProcessName);
if (oProcess.Length > 1)
{
MessageBox.Show("More than one instance is running!");
}
}
Tie in Max or Min Function - WITH TIES
If WITH TIES is also specified, all rows that contain the last value returned by the ORDER BY clause are returned, even if doing this exceeds the number specified by expression.
Top 1 could return two or even more rows in case of a Tie
Select TOP 1 WITH TIES BirthDate from HumanResources.Employee Order By 1 Desc
WITH TIES can be used to get the matching records of the last/first even if it is more than the given number or percent
WITH TIES requires an ORDER BY clause.
How to Convert CSV to XML using C#
Language Integrated Query (LINQ) can be used to convert a CSV file to XML. Here
is the sample CSV file that needs to be converted
The following code reads the CSV file to an array. LINQ is used to loop through
the array and the contents are written as XML using XElement (System.XML.Linq).
public void ConvertCSVToXML()
{
String[] FileContent = System.IO.File.ReadAllLines(@"C:\Temp\vba.csv");
String XMLNS = "";
XElement Inv = new XElement("Invoice",
from items in FileContent
let fields = items.Split(',')
select new XElement("Item",
new XElement("ID", fields[0]),
new XElement("Name", fields[1]),
new XElement("Price", fields[2]),
new XElement("Availability", fields[3]),
new XElement("TotalPrice", fields[4])
)
);
System.IO.File.WriteAllText(@"C:\Temp\vba.xml", XMLNS + Inv.ToString());
}
Subscribe to:
Posts (Atom)