When you shift + right click in Vista (or Server 2008) you will not find the trusted Run As ... Item, all you find is Run as Administrator. But this is not always what you need.
You can use the command prompt and the Runas command but this is not so easy as the old right click command.
Enter Sysinternals, they release a little tool called ShellRunAs that you can find here
After you downloaded it copy the ShellRunas executable to the windows\system32 folder and run shellrunas /reg
From this moment the run as different user item is back in your rightclick menu (or in your shift right click menu)
Thanks Sysinternals!
Tuesday, January 13, 2009
Thursday, December 18, 2008
Linq Where not exists query
Today I needed a where not exists query in my linq to objects.
Fortunatly I found it using the google :)
Suppose we have 2 lists, the first of a dummy class with properties Id and Name, the second of another dummy class with properties Id and Color (just so they are different)
We can perform a 'where not exists' query as follows :
This will give us a list having only the items in list1 that do not exist in list2, just as I needed.
Fortunatly I found it using the google :)
Suppose we have 2 lists, the first of a dummy class with properties Id and Name, the second of another dummy class with properties Id and Color (just so they are different)
We can perform a 'where not exists' query as follows :
var OnlyInFirstQuery = (from item1 in list1 select item1.Id)
.Except
(from item2 in list2 join list1Item in list1 on list2.Id equals list1Item.Id select item2.Id);
This will give us a list having only the items in list1 that do not exist in list2, just as I needed.
Thursday, October 9, 2008
Using Internet Explorer 6 on vista
There is probable a few people who would want to run ie6 on vista,
probably the webtesters (like me), or people who don't like ie7 (like me) but do not want to use opera or firefox (unlike me). And since the normal XP portable editions do not work, it seemed there was no answer.
Searching the google did not reveal much,
only that a lot of people were trying the same thing.
Luckily I found a great program IETester which makes this possible
(I did not test yet if it does everything IE6 does, but for my case, it was perfect).
the link is : IETester homepage
This program allows you to run your (or other) sites in
internet explorer version 5.5, 6, 7 and since the latest version 8 beta 2.
I hope this helps somebody!
probably the webtesters (like me), or people who don't like ie7 (like me) but do not want to use opera or firefox (unlike me). And since the normal XP portable editions do not work, it seemed there was no answer.
Searching the google did not reveal much,
only that a lot of people were trying the same thing.
Luckily I found a great program IETester which makes this possible
(I did not test yet if it does everything IE6 does, but for my case, it was perfect).
the link is : IETester homepage
This program allows you to run your (or other) sites in
internet explorer version 5.5, 6, 7 and since the latest version 8 beta 2.
I hope this helps somebody!
Wednesday, October 8, 2008
Window opened from javascript
When using javascript to open a window, it appears on top.
When this window loses focus (gets in the background),
and the user clicks the link again, the window is reloaded,
but does not get the focus again.
Since for some people this is important, the solution is to make sure the opened window has the focus :
This will refocus the opened window.
When this window loses focus (gets in the background),
and the user clicks the link again, the window is reloaded,
but does not get the focus again.
Since for some people this is important, the solution is to make sure the opened window has the focus :
var openedWindow = window.open("someurl", "somewindowname");
openedWindow.focus();
This will refocus the opened window.
Thursday, August 28, 2008
Internet Explorer 8 Beta 2
Microsoft has opened up the second beta for Internet Explorer 8
Some new features are :
- Accelerators : Select some text and a new Icon pops up, allowing you to search it with Google, mail it, ...
- Search bar improvements : Sizable, and it can show the first result for seaches on eg. wikipedia
- Web Slices
- Stability : Crash recovery and each tab has its own thread, so crashes should close only one tab.
- Tab groups : When opening a link from a tab, both tabs will get a color, indicating at a glance which tabs belong together.
- Inprivate Browsing (a.k.a. the porno modus) : When activated IE will not remember any cookies, or leave traces from the sites you have visited.
- And more (click here for the tour)
I installed it on vista, and it seemed a little faster (maybe my perception). Tabs groups seems very nice and useful. The first look is very nice, better than IE7, but I guess it will not yet replace my Opera :)
You can download the beta :
Here for XP
Here for Server 2003
Here for 64 bit XP/Server 2003
Here for 32 bit Vista/Server 2008
Here for 64 bit Vista/Server 2008
Enjoy :)
Tuesday, August 26, 2008
Linq To SQL Stored Procedure returns an Int
Today I was using Linq To Sql to execute a stored procedure wicht returned results by using a temporary table and dynamic sql (not my stored procedure)
Suprisingly enough when I dropped the procedure on the dbml file,
it generated a function with the return value typed as integer.
As it turned out, linq to sql and temporary tables don't play nice.
And since the database was a sql 2000 db, using table variables was not possible.
The solution turned out to be simple enough,
replace the stored procedure with a dummy one that returns the fields your normal procedure will return (names and type).
Then drop this stored procedure on the dbml file.
This will generate the correct return type for your procedure,
then simple alter the stored procedure to the correct one.
Hurrah, we can now use linq to sql to use our difficult stored procedure.
Suprisingly enough when I dropped the procedure on the dbml file,
it generated a function with the return value typed as integer.
As it turned out, linq to sql and temporary tables don't play nice.
And since the database was a sql 2000 db, using table variables was not possible.
The solution turned out to be simple enough,
replace the stored procedure with a dummy one that returns the fields your normal procedure will return (names and type).
Then drop this stored procedure on the dbml file.
This will generate the correct return type for your procedure,
then simple alter the stored procedure to the correct one.
Hurrah, we can now use linq to sql to use our difficult stored procedure.
Labels:
2008,
Linq to Sql,
Stored Procedure,
Temporary table,
Visual Studio
Subscribe to:
Posts (Atom)