Friday, August 3, 2007

microsoft clickonce publishing sucks (parts 1 and 2)...


"Microsoft .NET ClickOnce Launch Utility has encountered a problem and needs to close. We are sorry for the inconvenience". who is this "we" who is sorry? are they sorry enough to actual do something about it besides apologize? the details say applaunch.exe has a system.io.fileloadexception. this seems to be another example of microsoft putting out sloppy code. my google search shows nobody else reporting this problem. guess I'm just special :p

part 2 of why ClickOnce sucks? Joe Wirtley has already covered this very nicely - I found his post when I ran into the same problems as he did and I suggest you read it: ClickOnce and Bogus Required Assemblies.

Wednesday, August 1, 2007

microsoft visual studio help sucks (part 1)


notice in the screenshot step "2. click on the Compile tab". the option does not exist. therefore I cannot change my warning level. these guys sure have a hard time coordinating things (I presume at one time the program matched the help). btw, I originally posted this with windows live writer and somehow after posting to blogger, it got zapped. so I retyped this post. proper communication can be so difficult sometimes. sheesh!

microsoft windows live writer sucks (part 1)

try to publish to blogger with a picture included and you get the error:


funny, if I just use the regular blogger interface it works fine.  so why does microsoft give me options that their software doesn't support? this is a good reason to not use windows live writer.

Update: I (not surprisingly) am not the first to notice this problem. The Dino and friends futilely tried to work around it months ago.

Tuesday, July 17, 2007

erroneous InvalidCastException


todays puzzler may be hard to read in the screen shot above (click on image to expand) but basically the debugger is complaining that I'm trying to cast the value "0" to an integer value and it can't handle that. (fwiw, most people accept zero as a valid integer)... bizarre!

if ((int)Args.NewValues["ItemPrice"] < 0)
{
Args.Cancel = true;
EditMSG.Text = "-- Item price is out of range";
}

can anyone tell me why the if statement bombs when Args.NewValues["ItemPrice"] == "0"? I should think that would cast nicely to an int as I am attempting. (BTW Args is type DetailsViewUpdateEventArgs)

UPDATE:
here's a workaround --
if (Convert.ToInt32(Args.NewValues["ItemPrice"]) < 0)...

this way you're not casting, you're converting. ok!

Wednesday, July 11, 2007

asp.net debugging annoyance...

so I run my app and notice at the bottom left the yellow triangle with "!" warning "Error on page."
the details give this very unhelpful message:

Line: 2829
Char: 23
Error: Sys.ArgumentException: Value must not be null for Controls and Behaviors. Parameter name: element
Code: 0

where is this Line 2829? I know of no parameter named "element"... how does one track down such an error?

I hate this. and the only thing worse than Microsoft is everything else!

Monday, July 9, 2007

asp.net: how to autoGenerateSelectButton on gridView manually...

(I'll preface my post with "so" as the stereotypical microsoftie does)...

so I have this asp.net application that displays a grid of data. I want the user to be able to click anywhere on any row of that grid to start editing that row; something like data entry on a spreadsheet, but a little more controlled. dotNet 2.0 introduced a new control "gridview" to replace whatever else was used before. the event that gridview has that I want to use to trigger going into edit mode is SelectedIndexChanged - seems like a simple way to ID the row of interest and work on it. "seems" is the key word, because actually they made it hard to fire the event if you want to do anything different from the (ugly) way the control designers premade for you...

what they want you to do is use the "AutoGenerateEditButton" property to do the magic. funny they call it AutoGenerateEdit "Button" because it makes a URL looking link on the grid - not a button! then when you edit in the grid things jump around to fit the new fields that pop into the cells. looks awful.

so what you have to do to fake it out (which I'd rather not have to do, but there you go) was revealed on a google group search here

the trick is in Page_Load to add this code:

for (int i = 0; i++)
{
GridView1.Rows[i].Attributes.Add("onclick",
ClientScript.GetPostBackEventReference(GridView1, "Select$" + i));
}

(sorry I haven't figured how to make code format right under html yet).
also in the .aspx <%@ Page... %>directive you have to add a property not shown in VS: EnableEventValidation="False"

it works, but yuck! next, can I tackle edit mode?...

Sunday, July 8, 2007

new blog!

I decided today to devote a blog to my adventures in coding -- maybe this will garner more interest than my other non-work-related personal musings. so yes, posts here will primarily relate to my real job. stay tuned, ideas are gestating already!

About Me

My photo
smug SoCal catalyst prone to puffery. practitioner of verbal aikido. pearl caster for swine. professional. intuitive. clean. approachable. unique. forgiven sinner. ubiquitous. reads. geekiness rating ~10%. Meyers-Briggs = iNTj. musical thinker. into nature. project manager for a decent place which gives plenty of time, money and chances to prove his talent. dabbler, a dilettante, jack of all trades, master of none. lives in a nice place with a great wife and kids. his boys and attitude keeps him young. hangs out a lot, never bored. listens to XM. doesn't do favorites. tries to play the blues on acoustic guitar. loves the beach. draws. chillz' an groovz'. smokes a pipe. lefty.