DataView view = new DataView(table);
DataTable distinctValues = view.ToTable(true, "Column1", "Column2" ...);
Quick Notes for easy understanding. Chapters are on C#.Net,Linq,OOPS,Design Patterns,UML,Tools for development, Databases and many others. - Sid
Tuesday, November 8, 2011
Apply Distinct on Datatable
Thursday, October 27, 2011
winscp.exe COPIES FILES FROM UNIX TO WINDOWS
set LOGINAS=username:password@host
set SOURCE_PATH=/local/home
set DEST_PATH=d:\Test\
set SCRIPT_FILE=script.txt
set _Date=%date%
If "%_Date%A" LSS "A" (Set _NumTok=1-3) Else (Set _NumTok=2-4)
:: Default Delimiter of TAB and Space are used
For /F "TOKENS=2*" %%A In ('REG QUERY "HKCU\Control Panel\International" /v iDate') Do Set _iDate=%%B
For /F "TOKENS=2*" %%A In ('REG QUERY "HKCU\Control Panel\International" /v sDate') Do Set _sDate=%%B
IF %_iDate%==0 For /F "TOKENS=%_NumTok% DELIMS=%_sDate% " %%B In ("%_Date%") Do Set _fdate=%%D%%B%%C
IF %_iDate%==1 For /F "TOKENS=%_NumTok% DELIMS=%_sDate% " %%B In ("%_Date%") Do Set _fdate=%%D%%C%%B
IF %_iDate%==2 For /F "TOKENS=%_NumTok% DELIMS=%_sDate% " %%B In ("%_Date%") Do Set _fdate=%%B%%C%%D
Set _Today=%_fdate:~0,4%%_fdate:~4,2%%_fdate:~6,2%
set COPYFILE_1_PATRN=A1_TEST_%_Today%.txt
set COPYFILE_2_PATRN=B1_TEST_%_Today%.txt
Echo option batch abort>>%SCRIPT_FILE%
Echo option confirm off>>%SCRIPT_FILE%
Echo open %LOGINAS%>>%SCRIPT_FILE%
Echo cd %SOURCE_PATH%>>%SCRIPT_FILE%
Echo option transfer binary>>%SCRIPT_FILE%
Echo get %COPYFILE_1_PATRN% %DEST_PATH%>>%SCRIPT_FILE%
Echo get %COPYFILE_2_PATRN% %DEST_PATH%>>%SCRIPT_FILE%
Echo close>>%SCRIPT_FILE%
Echo exit>>%SCRIPT_FILE%
"C:\Program Files\WinSCP\winscp.exe" /console /script=%SCRIPT_FILE%
DEL %SCRIPT_FILE%
PAUSE
Tuesday, September 27, 2011
value from the enum ?
Question:
Is there any way that I can access the assigned value from the enum?
Eg: When my item is Red then I want get the corresponding value That’s ‘R’. Is that possible?
public enum Color
{
Red = 'R',
Blue = 'B',
Green ='G',
Yellow ='Y',
White = 'W'
}
Answer:
Yes by this way –
class Program
{
static void Main(string[] args)
{
Console.WriteLine((char)Color.Red);
}
}
public enum Color
{
Red = 'R',
Blue = 'B',
Green ='G',
Yellow ='Y',
White = 'W'
}
Friday, September 23, 2011
Tracking CPU and Memory usage per process
Just type perfmon into Start > Run and press enter. When the Performance window is open, click on the + sign to add new counters to the graph. The counters are different aspects of how your PC works and are grouped by similarity into groups called "Performance Object".
For your questions, you can choose the "Process", "Memory" and "Processor" performance objects. You then can see these counters in real time
You can also specify the utility to save the performance data for your inspection later. To do this, select "Performance Logs and Alerts" in the left-hand panel. (It's right under the System Monitor console which provides us with the above mentioned counters. If it is not there, click "File" > "Add/remove snap-in", click Add and select "Performance Logs and Alerts" in the list".) From the "Performance Logs and Alerts", create a new monitoring configuration under "Counter Logs". Then you can add the counters, specify the sampling rate, the log format (binary or plain text) and log location.
For more information follow this link.
http://stackoverflow.com/questions/69332/tracking-cpu-and-memory-usage-per-process
Wednesday, August 10, 2011
Spool in unix
Login to oracle
Sqlplus user/pwd@database
Spool filename.txt
Select * from dual;
Spool off
Saturday, July 9, 2011
Deligates small note.
Delegates in C# are objects which points towards a function which matches its signature. Delegates are reference type used to encapsulate a method with a specific signature. Delegates are similar to function pointers in C++; however, delegates are type-safe and secure.
Here are some features of delegates:
A delegate represents a class.
A delegate is type-safe.
We can use delegates both for static and instance methods
We can combine multiple delegates into a single delegate.
Delegates are often used in event-based programming, such as publish/subscribe.
We can use delegates in asynchronous-style programming.
We can define delegates inside or outside of classes.
Syntax of using delegates
//Declaring delegate
delegate void SampleDelegate(string message);
// declare method with same signature:
static void SampleDelegateMethod(string message) { Console.WriteLine(message); }
// create delegate object
SampleDelegate d1 = SampleDelegateMethod;
// Invoke method with delegate
d1("my program");
Monday, June 20, 2011
How to install a Windows service using command line ?
Code Formater
| Paste Here Your Source Code | ||||||||||||||
| Source Code Formatting Options | ||||||||||||||
|
||||||||||||||
| Copy Formatted Source Code | ||||||||||||||
| Preview Of Formatted Code |