Archive

Archive for December, 2005

Iframe preloader

December 21, 2005 Leave a comment
This is a nice bit of javascript to put a pre-loader on an Iframe, so your users have something to look at while an Iframe is loading
 
<iframe id="imgGraph"></iframe>
           <script language="JavaScript">
            var graph = document.getElementById("imgGraph");
            graph.contentWindow.document.write(‘please wait’);
           graph.src=’http://www.whatever.com&#8217;;
<script>
 
Advertisements
Categories: Uncategorized

Changing the dataType of a DataColumn after it has data

December 8, 2005 Leave a comment
I was looking into a problem where a datagrid had a datetime field that was being sorted alphabetically rather than chronologically.
 
This was happening because the datacolumn was a string rather than a DateTime, it had to remain a string for formatting purposes. You can’t change it by Just saying DataColumn.DateType=… because the column had data already: However, this is how I changed it:
 

private void changeColumnType(string columnName,System.Type newType,ref DataTable inputTable)

{

DataColumn dcUpdated;

dcUpdated = inputTable.Columns.Add("_temp_", newType);

foreach(DataRow drUpdated in inputTable.Rows)

{

drUpdated["_temp_"] = drUpdated[columnName].ToString();

}

inputTable.Columns.Remove(inputTable.Columns[columnName]);

dcUpdated.ColumnName = columnName;

}

 
 
Categories: Uncategorized

App.path for access

December 6, 2005 Leave a comment
I was just looking for the equivalent of App.path for access macros – it’s CurrentProject.path
(i.e. the location of the current database on disk)
 
Just back from a weekend in Rome, with my girlfriend Anna. If anybody is thinking of going to Rome, I have to recommend a lovely coffee shop called Area 5. Just accross the bridge, from castello della angeli, then up a side street towards piazza Navona. Lovely food, and very cheap too!.
 
 
 
Categories: Uncategorized