Search This Blog

Thursday, October 20, 2011

Enable xp_cmdshell in SQL server 2008

Use t-sql to turn on  xp_cmdshell in SQL server 2008

Run this on the master database.
Source:

EXECUTE SP_CONFIGURE 'show advanced options', 1
RECONFIGURE WITH OVERRIDE
GO
 
EXECUTE SP_CONFIGURE 'xp_cmdshell', '1'
RECONFIGURE WITH OVERRIDE
GO
 
EXECUTE SP_CONFIGURE 'show advanced options', 0
RECONFIGURE WITH OVERRIDE
GO


Monday, October 17, 2011

Google Data API Service names

Why does a company completely screw up a perfectly good web site design? Microsoft has routinely done this over the years for no good reason. Google certainly has done this since it started turn off services. So I am blogging this because Google's API documentation which was decent as GData is become more convoluted. I guess more money does not always make things better.

Also, I would also like to express my disappointment with FireFox version .  Thanks for killing a nice browser forcing me to use Chrome on XP and IE on Windows 7.  Nice job guys!

Source url:

Authentication



What is the service name in ClientLogin for each Data API?



A "service name" is a brief string that the ClientLogin authentication system uses to identify a Google service.
Google APIService name
Google Analytics Data APIsanalytics
Google Apps APIs
(Domain Information & Management)
apps
Google Sites Data APIjotspot
Blogger Data APIblogger
Book Search Data APIprint
Calendar Data APIcl
Google Code Search Data APIcodesearch
Contacts Data APIcp
Content API for Shoppingstructuredcontent
Documents List Data APIwritely
Finance Data APIfinance
Gmail Atom feedmail
Health Data APIhealth
weaver (H9 sandbox)
Maps Data APIslocal
Picasa Web Albums Data APIlh2
Sidewiki Data APIannotateweb
Spreadsheets Data APIwise
Webmaster Tools APIsitemaps
YouTube Data APIyoutube
For more information on the other parameters used in a ClientLogin request, see the ClientLogin documentation.






Friday, October 14, 2011

Dragging and dropping rows between DataGridViews

Okay, I set out to reproduce code I have in VB6 with grids copying rows between grids to C# using DataGridView.
Works great except if more than one row is selected. Found this article below

Turns out MouseDown event unselects all but the row under the mouse cursor. To prevent this, I have to create a new custom control derived from DataGridView and overrride OnMouseDown() to prevent base.MouseDown() from firing if more than one row is selected.

This leaves me thinking...

I hate having to create a custom control every time I want to rid a winform control of a bad behavior buffering or event related. Because this unwanted behavior is almost always found after form design is completed.
But this an epiphany occurred to me about winforms. I should consider creating custom controls for all of the standard controls you are using. Seems like a pain but control creation is easy and then I get much better control of my application rather than setting for Microsoft's default.

This is similar to the earlier epiphany I had concerning docking and anchoring controls, where if you make sure controls are in panels and splitters and then in turn these containers are placed in Flowlayoutpanels or tablelayoutpanels, UI design with WInform because understandable and actually fun.

Too bad, I can't this kind of incite to a dev language and platform before I start a new project.

having trouble with drag-n-drop of multiple items:

'via Blog this'

also http://adamhouldsworth.blogspot.com/2010/01/datagridview-multiple-row-drag-drop.html

c# - How could I Drag and Drop DataGridView Rows under each other? - Stack Overflow

Love stackoverflow.com Found C# Example of drag and drop. Implemented a variant of this solution in less than an hour.

c# - How could I Drag and Drop DataGridView Rows under each other? - Stack Overflow:

Monday, October 3, 2011

Formatting a data bound Textbox for currency

This was surprisingly hard with a simple solution:

Bind textbox to data source and the set the format string on the databinding
Reference: http://social.msdn.microsoft.com

TextBox1.databindings.add("Text",myobject,"myfield",True)
TextBox1.databinding(0).formatstring="c"

Easy once you now the answer! :)