Sunday, October 7, 2012

Spreadsheetgear and dates

when you import dates from a s/sh , then if the format is set SG will get the value and format and allow you to acces the text. if however you are importing a csv - it will attempt to convert to the current culture

how to deal with a different format than the current culture:


CultureInfo TempCulture = (CultureInfo)Thread.CurrentThread.CurrentCulture.Clone();
                    TempCulture.DateTimeFormat.ShortDatePattern = dateFormat;
                    //Thread.CurrentThread.CurrentCulture = TempCulture;
                    _wb = SpreadsheetGear.Factory.GetWorkbookSet(TempCulture).Workbooks.OpenFromStream(stream);
                    _data = _wb.GetDataSet(SpreadsheetGear.Data.GetDataFlags.FormattedText );
 

when converting to datatables make sure to get the formatted text:



DataSet dataSet = wb.GetDataSet(SpreadsheetGear.Data.GetDataFlags.FormattedText );

likewise:

range.CopyFromDataTable(dt, SpreadsheetGear.Data.SetDataFlags.AllText);
 



Thursday, October 4, 2012

Another difference between sc and installutil

if the actual exe is deleted (after the service is stopped) installutil /u will fail as opposed to sc

Friday, September 28, 2012

convert image to text



SELECT
convert(varchar(max),convert(varbinary(max), FILE_CONTENT)) from blah

Friday, September 14, 2012

referring to asp.net server side in javascript

it may be easier to put the whole string under server side rendering
a'la:
onchange = '<%# "checkDefault(this.value,\"" + Container.FindControl("defaultValue").ClientID + "\");"%>'

Thursday, September 13, 2012

Tuesday, September 11, 2012

select dropdown by text

this.drpLayouts.SelectedIndex = this.drpLayouts.Items.IndexOf(this.drpLayouts.Items.FindByText(this.layoutName.Text));

vs2010 cannot start debugger

was really just an invalid identity on my app pool because I changed passwords.