Skip to main content

Posts

Automatic class or object maker for Access tables in C#

The entity framework is all very well when you run SQL. But what about all of us that are running Access, or are porting old access systems to the web and need to keep legacy systems in place? I was keen to us the object data source to work with data and could not find anything that was able make a class for me. So I wrote my own that listed the tables in the database, then created the class file and stored it in the temp directory. I have a separate code folder to dump these in so that the project does not play with them, rather than dumping them into the App_Code  folder, but you can change this. I placed this code in the test folder of my app which is called  TrackerDotNet So here is the code: First the HTML file <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AutoClassMaker.aspx.cs" Inherits="TrackerDotNet.test.AutoClassMaker" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "ht...

Clearing invoices marked for emails send later or batch in Quickbooks 2013

One of the few great new features in Quickbooks 2013, is that fact that you can send batch emails. The problem with this feature is what happens if you have a whole lot marked for batch, and you only want ot send one lot. Well it look like you are up the paddle without a stream. Here is how I solved it. What you need: QB 2013 Outlook Method 1. In Outlook take it off line, this varies per the version some you can just right click in the task bar others you need to go to Send/Receive->Work offline 2. Go to Quickbooks. Under preferences make sure the email is set to be sent via Outlook. I normally have this off, as since 2006 version I have had problems sending PDF files direct to clients, instead I use a gmail account that automatically forwards reply back to my accounts email. So I have this set to SMTP. But for this excercise, in Quick Books Edit->Preferences->Send Forms. I have set the Send Email Using to Outlook 3. Open up an invoice / estimate. Click on the a...

VBA retrieve and current Row and Colum, in Excel

I wanted to store Row and Column in a VBA macro, and could not really find a good source for the how to anywhere so thought I would document how I did it:   Dim actRow As Integer   Dim actCol As Integer   Dim actRange As String   actRow = ActiveCell.Row   actCol = ActiveCell.Column    ' I actually want 2 rows up in the same colum.   actRange = Chr$(Asc("A") + actCol) + CStr(actRow - 2)   Range(actRange).Select You can change the row and col by just adding 1.

Audible - solving the echo

I love audible, being in the car a lot I use the product a lot. Weather it is a book that is educational, motivational or fiction it is a great service. So recently I got fustrated. I download a new book on to my iPhone and it had a terrible echo. I had downloaded books before where the audio quality was not very good, so assumed it must be the recording. I requested that they exchange the book online which they did and I then I got a new book same problem. Guess how easy it is to fix. On the front page, on the bottom right there is a speed setting, check what it is set too. My echo was caused by it being set to .75x I changed it to 1x and echo gone ;)

Integral life practice a perspective, if you have a heart beat buy thisbook

In the last year I have spent a lot of time reading and researching many books by some brilliant authors. James Hollis, Deepak Chopra, Wayne dryer, the Dali Lama, Ken Wilber,  Caroline  Myss  and Ekhard Tolle to name a few. No this is not a name dropping exercise but rather an introduction. Add to that the many leadership and google talk and sounds true self acceptance videos I have watched and listened to over the last year, and my mind is still searching for my own perfect porridge like Goldilocks, but I feel happier doing it.  I would still recommend that each individual, goes on their own internal quest to try get a better understanding of themselves, their ego and their own spiritual beliefs.  But I think that any logical individual needs to look at the book "The Integral life Program" by Ken Wilber and co. Why is this book a must. Well it firstly breaks things down into easy to understand sections of life. Namely mind, body, spirit and s...

String index array to calculate totals using Dictionary type

Thought I would document this, since it took me a while to gather all the information to do it, but once I got it, it was very useful. I searched things like how to create a string indexed array and, multidimensional arrays and lists to eventually find the Dictionary Type, very powerful, and you can link it with objects/classes and lists to extend it. Essentially I was running a SQL query where I am building a complex table using a number of conditions, and could not use GridView because of that. But I also wanted a total at the bottom. So created a Total Table in the asp page. Then in the code file this is what I added: class ItemTotals {   public string ItemDesc { get; set; }   public double TotalsQty { get; set; } } //---- // code to run query... which returns into oleData //---- string _strItemDesc = oleData["ItemDesc"].ToString(); if (sumItemTotals.ContainsKey(_strItemDesc)) {    sumItemTotals[_strItemDesc].TotalsQty += Conver...