Too much reading, too little time?

Posted by Dave @ EHS Tue, 18 Sep 2007 20:34:00 GMT

One of the things I love about being a software developer is learning new skills, there is always some new area to look into.

However sometimes the books, articles, blogs, magazines and newsletters do mount up a bit. And there is usually too muchwork to do to do any of it.

Imagine if there was a way you could get through all of your reading in a fraction of the time. Such is the promise of PhotoReading a revolutionary way to utilize the power of your whole mind to do just that.

Now I'm a skeptical person by nature and my immediate reaction was reminisent of Cartman from South Park "It sounds like a load of tree hugging hippie cr$p", but hey the sub consious mind is indeed a powerful thing. How many times have we all spent hours trying to debug some knotty problem only to give up and then hours later whilst having dinner a sudden flash of inspiration solves the problem.

Anyway having put my skeptisism on hold and ordered a copy of the course I have to say it is very impressive. Just need to find enough time now to sit down and go through the CD's.

 

 

my.Settings.connectionstrings are application scope and therefore readonly!

Posted by Dave @ EHS Tue, 07 Nov 2006 22:49:00 GMT

What is that about, how can something fundamental like the connection string not be able to be changed at runtime. After much blood sweat and tears looking into this there is a work around. It's a bit of a fudge but it works:

To quote RadicalSoftwareSolutions

from this thread

Hi All

I have found a workaround to this but I'm still looking for a better solution (i.e changing the app.config files)

The solution I have used involves changing the settings.desogner.vb code which is created by the dataset design tool. The only reason my.settings. are read only is that the designer only creates a "Get" property for them, its a 2 line change to add the "Set" property (since all we're doing is storing a string value there!). I then set the value to what I want in the settings.vb.settingsloaded function.

Ok it's not perfect as the settings.designer.vb gets re-written every time the designer is changed but you'll know if that's happened as the connectionstring will become readonly again and your code won't compile.

Obviously you'll have to do this for each connectionstring if you have more than one and don't forget to remove the "readonly" value from the property command

Ian

Thanks Ian, I thought I was going mad there for a while...

TSQL Functions you wish existed

Posted by Dave @ EHS Tue, 03 Oct 2006 21:53:00 GMT

Ever dismayed by the lack of seemingly obvious functions that TSQL just doesn't seem to have? Well here is a fantastic collection of user defined functions to complete an impressive array of tasks.

rand() in TSQL isn't random at all!

Posted by Dave @ EHS Thu, 14 Sep 2006 15:54:00 GMT

Trying to return a query with a random sort order from TSQL I thought the most obvious
way would be like this:


SELECT *
FROM Northwind..Customers
order by rand()

However for a multi line select statement the value of rand() will be the same for each
row.

This article here has a neat work around with a custom view and a custom function.

However a colleague rightly pointed out that this will do the trick.

SELECT *
ROM Northwind..Customers
order by newid()

 

Thanks Val!