Thursday, October 2, 2008

format date in xaml

xmlns:local="clr-namespace:.Utility">






//DateTime format Binding
namespace .Utility
{
///
/// Utility class to convert the date format
///

public class PositionConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value != null)
{
//converts the format during Binding
return String.Format("{0:s}", value).Remove(10);
}
return "";
}

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{

throw new Exception("The method or operation is not implemented.");
}

}
}

date format tht will help you out,

DateTime dateTime = DateTime.Now;
C.WriteLine ("d = {0:d}", dateTime ); // mm/dd/yyyy
C.WriteLine ("D = {0:D}", dateTime ); // month dd, yyyy
C.WriteLine ("f = {0:f}", dateTime ); // day, month dd, yyyy hh:mm
C.WriteLine ("F = {0:F}", dateTime ); // day, month dd, yyyy HH:mm:ss AM/PM
C.WriteLine ("g = {0:g}", dateTime ); // mm/dd/yyyy HH:mm
C.WriteLine ("G = {0:G}", dateTime ); // mm/dd/yyyy hh:mm:ss
C.WriteLine ("M = {0:M}", dateTime ); // month dd
C.WriteLine ("R = {0:R}", dateTime ); // ddd Month yyyy hh:mm:ss GMT
C.WriteLine ("s = {0:s}", dateTime ); // yyyy-mm-dd hh:mm:ss (Sortable)
C.WriteLine ("t = {0:t}", dateTime ); // hh:mm AM/PM
C.WriteLine ("T = {0:T}", dateTime ); // hh:mm:ss AM/PM

Monday, September 15, 2008

XBAP IOException: Cannot locate resource file.xaml

Tuesday, September 2, 2008

Use OpenXML on an Xml document with a default namespace

this is an interesting stuff

BEGIN

SET NOCOUNT ON;
declare
@XmlAddHandle int,
@XmlDeleteHandle int,
@xmlString varchar(max)

set @xmlString = '


e27b4a1b-3f75-44b2-9538-4acc108505d2
nokia 6280
In Work
child scenario
2008-08-23T00:00:00+05:30
planner
17bb0215-1daa-4195-96e2-9feeefecac73


e27b4a1b-3f75-44b2-9538-4acc108505d2
ed5c9c5e-5b59-49af-add2-d16a08b686df
2008-09-01T14:59:10.953+05:30

'

EXEC sp_xml_preparedocument @XmlAddHandle output, @xmlString,''

SELECT * FROM OPENXML(@XmlAddHandle,'//a:Scenario',2) WITH ([a:Status] varchar(20))


EXEC sp_xml_removedocument @XmlAddHandle

END

Thursday, August 28, 2008

return xml from sql server

select * from table name FOR XML RAW, ELEMENTS XSINIL, BINARY BASE64

Wednesday, August 27, 2008

change column name of sql table

EXEC sp_rename
@objname = 'TableName.FieldName',
@newname = 'NewFieldName',
@objtype = 'COLUMN'

Wednesday, August 20, 2008

selecting a combobox value in WPF

now im in WPF browser application ,
everything seems to be complicated unless otherwise

System.Windows.Controls.ComboBoxItem Value = this.cmbStatus.SelectedValue as ComboBoxItem;

Value.Content.ToString();

Monday, August 4, 2008

crm 4.0 look up

editing the values of look up based on parent lookup is possible.

sample code to do it,

var lookupItem = new Array;

// This will get the lookup for the attribute primaryid on the Account form.
lookupItem = crmForm.all.new_customerlogbookid.DataValue;

if ( lookupItem[0] != null )
{

var cutomerID = lookupItem[0].id;

var entityForList = "new_bd_oppurtunity";
var attribForFilter = "new_customerlogbookid" ;
var idToFetch = cutomerID;

try{

var fetchStr = "" +
" " +
" " +
" " +
" " +
"
" +
"
" +
"
";

} catch ( e ) { alert(e); }

crmForm.all.new_oppurtunityid.lookupbrowse = 1;
crmForm.all.new_oppurtunityid.AddParams("search", fetchStr);


} else { alert("No values"); }

Wednesday, July 30, 2008

cHTml help files stopped working

suddenly these help files stopped working.. after some times of googling hrrrr... i found the solutions,

Go to C:\Documents and Settings\enlim\Application Data\Microsoft\HTML Help on the computer
2. Delete the hh.dat3.
4. Then later register the file regsvr32 c:\windows\system32\hhctrl.ocx

if it dont start try these steps which will definitely works

regsvr32 hhctrl.ocx
regsvr32 itss.dll
regsvr32 itircl.dll

Command Prompt

i really am interested in working with command prompt, old way though.

You cannot change to a UNC path at a command prompt. However, you can use the pushd command to access a network path. If command extensions are enabled (this is the default in Windows 2000), the pushd command accepts network paths in addition to drive letters and paths. If you specify a network path, the pushd command creates a temporary drive letter that points to the network resource, and then changes the current drive and folder to the new drive letter. Temporary drive letters are allocated starting from Z and then backward through the alphabet, using the first unused drive letter found.

To use the pushd command, type the following line at a command prompt, where uncpath is the UNC path for the network share that you want to use:

pushd uncpath

For example, to connect to a share named Sharename on a server named Servername, type the following line, and then press ENTER:

pushd \\servername\sharename

You can use the popd command to remove the top folder from the stack. The popd command returns you to the previous folder, and removes the temporary drive letter that was created by the pushd command.

Wednesday, June 25, 2008

Cool Sayings

"In real life, unlike in Shakespeare, the sweetness of the rose depends upon the name it bears. Things are not only what they are. They
are, in very important respects, what they seem to be."
-Hubert H. Humphrey

"The soul which has no fixed purpose in life is lost; to be everywhere, is to be nowhere."
-Michel de Montaigne

"Carpe diem! Rejoice while you are alive; enjoy the day; live life to the fullest; make the most of what you have. It is later than you
think."
-Horace

"Four things come not back: the spoken word, the sped arrow, the past life and the neglected opportunity."
-Proverb

"If we let things terrify us, life will not be worth living."
-Seneca

"Life is a sum of all your choices."
-Albert Camus

"The spirit of resistance to government is so valuable on certain occasions that I wish it to be always kept alive."
-Thomas Jefferson

"Every man has a right to risk his own life for the preservation of it."
-Jean-Jacques Rousseau

"Life shrinks or expands in proportion to one's courage."
-Anais Nin

"And this our life, exempt from public haunt, finds tongues in trees, books in running brooks, sermons in stones, and good in
everything."
-William Shakespeare

Tuesday, June 24, 2008

Nokia Acquires Symbian; Takes on Google's Android

Nokia isn't finished with its acquisition spree just yet. Tonight the Finnish company announced a plan to acquire the 52 per cent of Symbian it doesn't already own and make the platform open source. Nokia clearly aims to challenge Android, the open source mobile operating system of Google. Nokia CEO Olli-Pekka Kallasvuo says that it wants to create "the most attractive platform for mobile innovation and drive the development of new and compelling web-enabled applications".

my blog

"We are here to add what we can to life, not to get what we can from life."
-William Osler

"Every man desires to live long, but no man wishes to be old."
-Jonathan Swift

" I call it... the hot dog tree, because... it's a hot dog tree."
-Pee Wee Herman

" Sun is bad for you. Everything our parents said was good is bad. Sun, milk, red meat... college."
-Alvy Singer, Annie Hall

"No culture can live, if it attempts to be exclusive."
-Mahatma Gandhi

"You never really understand a person until you consider things from his point of view... 'til you climb inside of his skin and walk
around in it."
-Atticus Finch, To Kill a Mockingbird

"Life is either a daring adventure or nothing. To keep our faces toward change and behave like free spirits in the presence of fate is
strength undefeatable."
-Helen Keller

"Life is a great big canvas, and you should throw all the paint you can on it."
-Danny Kaye

"The universe is change; our life is what our thoughts make it."
-Marcus Aurelius

"No matter how qualified or deserving we are, we will never reach a better life until we can imagine it for ourselves and allow ourselves
to have it."
-Richard Bach