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"); }