Showing posts with label Languages. Show all posts
Showing posts with label Languages. Show all posts

05 December, 2011

When SxecuteScalar() returns null

The Greek lowercase omega (ω) character is use...Image via Wikipedia
05-Dec-2011

I was working on a new web page today, and I decided to use ExecuteScalar() as my method to fetch a singular data that returns a string.

I completed the whole code, and during debugging, I encountered some issues. One of them is simply throwing an exception, and when I stepped through, I found that it was due to a null value being returned by the ExecuteScalar() procedure.

I then checked from the web on possible solutions to this problem, and after putting in all the patches, all scenarios can now be handled.

Here’s how it works. Detect first if the return value is null, then handle it appropriately:

if (cmd.ExecuteScalar() == null)
{
:
:
}

An else clause is then added to handle possible return values other than null:

else
{
bfrResult = cmd.ExecuteScalar().ToString();
:
:
}

And that’s all there is to it. Hope that this helps you also, as it did me.

Till then!


Enhanced by Zemanta

28 August, 2011

Registration Codes for Visual Studio 2010 Express Edition

borderless
borderless (Photo credit: Wikipedia)
Image via WikipediaI have these registration codes generated for my home PC, and I may need them at work, where this code generation is blocked by a firewall.

Others can use the same code, I believe. It is free.

VB 2010 Express:
removed!

VC# 2010 Express:
removed!

VWebDev 2010 Express:
removed!


Happy Visual Studio-ing!



Enhanced by Zemanta

18 April, 2011

Scriptin' with Javascript and Ajax

Charles Wyke-SmithImage by linoleum jet via FlickrI am done reading this book, and while I can say that it is almost in the same line of methodologies as the other book from Riders (Bulletproof Ajax), they have different offerings.

Scriptin' focuses on reuseable javascripts, and the final two chapters is supposed to be a working example that brings in all the discussed knowledge.

Unfrotunately for me that can't materialize. It was dealing with PHP, and I don't have a server that runs PHP.

Anyway, the javascripts I have learned just fine, expecially those nice formatting techniques, stripes, character counting, etc., etc.

And of course, these functionalities, more or less, are somewhat available in the Visual Web Developer toolkit.

So what's good about this book?

I know from the ground up how these already-available controls work. If I have to code by hand, I may struggle, but I can survive. I can continue. I won't be stuck.

I can go on Scriptin'!
Enhanced by Zemanta

28 March, 2011

On to Silverlight and Ajax

Microsoft Silverlight 4 For DummiesI have began my journey to learning Silverlight and Ajax. I have completed my first books, Microsoft Silverlight 4 for Dummies and Bulletproof Ajax, aside from the books that I have got from my official course (2957B and 6463A).

I am glad that I came to read Bulletproof Ajax first, since it presents Ajax in a very general scope, and the while the book presents a lot of examples that accompanies the topic at hand, it isn't structured in a way that it immediately does into details. It gives you a view of the mountains and the path up ahead before taking the first step into the woods.

As for the other book, MS Silverlight 4 for Dummies, it is immediately dealing with examples while explaining the concepts, so that you do immediately while reading. This isn't totally bad, as many learners would want to do it immediately, running before walking.

Bulletproof Ajax 1st (first) edition Text OnlyWith these 2 books completed, I've grabbed a few others that will continue my learning of Silverlight and Ajax, what I believe to be the future of web programming.

And not to mention, I am new to the world of web, being a Windows application developer. I am sure that this will be a long and exciting journey.

Travel with me!
Enhanced by Zemanta

22 February, 2011

String to StringBuilder, AJAX, Silverlight

.Net Framework LogoImage via WikipediaAfter a week-long course on 2957B and 6463A, I found some new ways to make my applications run faster and sleeker (performance- and graphics-wise).

I know, these are not new, but I didn't know better before.

  • String to StringBuilder
  • Double buffering
  • AJAX
  • Silverlight

Silverlight 4 UnleashedString to StringBuilder

Especially when manipulating strings, 2 - 3 times at most, the String var type is still OK. More than that, you should be considering the use of StringBuilder.

One of the problems that I encountered with StringBuilder is the clearing or blanking off of the var. Then I found out that in .NET Framework 4.0, the Clear() method is already available. In 3.5 or lower, you can set the Length = 0, which effectively resets the char length.

The StringBuilder also has Append() and Appendline() methods, which effectively obsoletes the equivalent coding for String, like "& vbCrLf", etc.


Double buffering

A very simple functionality, but like I said, I didn't know better. So my Windows forms are now flicker-free.


AJAX and PHP: Building Modern Web Applications 2nd EditionAJAX

Now this is new. I am yet to implement this, because Web forms are a transition for me, at least I know that there is a technology that is available to my use - for a better experience of my users, performance-wise!


Silverlight

Adding to AJAX, Silverlight is another trick up my sleeve. Well, this is on the graphics side of webpages, so that they are more pleasing and more attractive.


Foundation Expression Blend 4 with SilverlightAnd these are some of the big things that I have 'learned' in my week-long course, so hopefully, I now will be a better software developer.

Till then.

Enhanced by Zemanta

07 July, 2010

Running javac in Windows

Image representing NetBeans as depicted in Cru...Image via CrunchBase
I just began my self-study in java using Netbeans 6.9 IDE, and I just managed to get through the "Hello World!" code using the IDE, which is followed by running the same small program in the shell.

I typed the compiler as indicated in the directions, but I got an error, like 'javac is not recognized....' or something like that.

I searched the web, which is usually my primary source of assistance, as it is with my self-study matters, and I got the first page with the top results containing the solution to my problem.

It is simply including the javac location in the PATH declaration.

So I did.

I opened up a Windows Explorer, right click on My Computer, and on Properties, then on Advanced tab, then on Environment Variables, then on the top window, which is the user's "User variables".

Open up "PATH" or "path", whichever is the one in your PC, then include the javac directory, for my case, is "C:\Program Files\Java\jdk1.6.0_01\bin> javac". That means going to the end of the current definition, adding a semicolon, then the file location, which is again, "C:\Program Files\Java\jdk1.6.0_01\bin> javac".

Click on OK, then the other OK, and the final thrid OK.

That sets the path for javac. There is no need to restart your PC, as was the case for me. But if javac still isn't recognized, try to do a restart, to be sure.

Till then.

Enhanced by Zemanta

08 April, 2010

C going up the list, actually top of the list

JavaImage via Wikipedia
What is C's rise to the top (again) have got to do with me? I mean, I'm using C# in the .NET package, and also VB and ASP. And though I wanted to delve into Java, I've not gone close enough, or even near, to be considered an intermediate-, or even a beginner-level at that.

But for those of you out there who are into Java and C programming languages, I think this news matters. It may be actually dictating the trend (and future employability) of software developers in this arena.

Read on:

----------
"After more than 4 years C is back at position number 1 in the TIOBE index. The scores for C have been pretty constant through the years, varying between the 15% and 20% market share for almost 10 years. So the main reason for C's number 1 position is not C's uprise, but the decline of its competitor Java. Java has a long-term downward trend. It is losing ground to other languages running on the JVM. An example of such a language is JavaFX, which is now approaching the top 20."
----------

What's on your mind? Do leave a comment - here - or check out what others are saying at the source here.


Reblog this post [with Zemanta]

02 August, 2009

Chinese hackers crash Australian festival website

Southbank, a new icon of MelbourneImage via Wikipedia

A series of internet attacks, back when US was apparently hit by some hackers, now it is Australia’s turn.

Their festival website was attacked by Chinese hackers.

Did the prank message or code appeared in Chinese character? How was their code understood by an English operating system?

That would be quite interesting!

Chinese hackers crash Australian festival website

Reblog this post [with Zemanta]