tag:blogger.com,1999:blog-162101442024-03-08T08:30:50.649+03:00@360AgileWeb Blog CornerSo I am a developer. Or should I say a web developer. I write code for a living. I love coding. I also love talking about it.
Indeed we do find ourselves having to learn new technologies is a short spell of time. On this blog, I will try keep abreast with technological challenges.
Join me in learning and sharing with the community our journey in coding.Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.comBlogger55125tag:blogger.com,1999:blog-16210144.post-83574285833760906002011-06-03T18:51:00.000+03:002011-06-03T18:51:59.513+03:00Using C# String.Format “{0:p0}” without the leading space before percentage signSimplest expresssion is:
String.Format("{0:0%}", 0.10)
A more elegant solution is:
Use the NumberFormatInfo.PercentPositivePattern Property:
NumberFormatInfo numberInfo = new NumberFormatInfo();
numberInfo.PercentPositivePattern = 1;
Console.WriteLine(String.Format("{0}", 0.10.ToString("P0",numberInfo)));
Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com4tag:blogger.com,1999:blog-16210144.post-53911528745623512192011-05-26T15:35:00.000+03:002011-05-26T15:35:26.398+03:00Formatting RDL/RDLC values as percentageI thought I'd share how to format percentage values in ReportViewer report.
Say your data source has the following fields:
TotalLow
TotalHigh
Total
Suppose we want to display the values for TotalLow and TotalHigh as percentage of Total.
We can use the following expressions.
=String.Format("{0:p0}",Sum(Fields!TotalLow.Value)/Sum(Fields!Total.Value))
=String.Format("{0:p0}",Sum(FieldsJulius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-62860126979598616992011-05-12T16:20:00.000+03:002011-05-13T23:36:43.477+03:00SQL Service fails to start with error code 126Got this tweet notification: @myitforummyitforumSQL Service fails to start with error code 126 http://tinyurl.com/3cmehr7 #SysCtr Thought I'd share the links which I found useful too.http://techiethings.blogspot.com/2009/01/sql-server-service-not-starting.html
http://blogs.msdn.com/b/sql_protocols/archive/2005/12/05/500013.aspx
http://blogs.msdn.com/b/sql_protocols/archive/2006/04/28/Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-290111991913327632011-05-06T17:41:00.001+03:002011-05-06T17:41:55.278+03:00Coding Standards, why the heck?Coding standards. Yes. Coding standards. Why do we need them?
I was reviewing our companies coding style document and thought I share with you some references I have come across.
The essence of enforcing coding standards is to have coding style - which is good for management of your code base and consistency. And overall, improves productivity of your developers.
Here are some useful links on Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com2tag:blogger.com,1999:blog-16210144.post-52472801222463724312011-03-17T13:36:00.000+03:002011-03-17T13:36:11.672+03:00Calling ASP.NET WebMethod with more than one paramaters using JSONSuppose we have a web method in ASP.NET web form or webservice
[WebMethod]
public void GetItems(string itemName, string itemDesc)
{
}
Using jQuery, we are going to call this method using the code like this below. I am pre-suming there is a search button which we have assigned id #searchNow
$(document).ready(function () { Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-78069036230125988932011-02-25T14:10:00.000+03:002011-02-25T14:10:57.923+03:00Constructing Javascript Date object using custom date string format e.g. dd/mm/yyyyThe Date object is used to work with dates and times.
Date objects are created with the Date() constructor.
There are four ways of instantiating a date:
new Date() // current date and time
new Date(milliseconds) //milliseconds since 1970/01/01
new Date(dateString)
new Date(year, month, day, hours, minutes, seconds, milliseconds)Date(dateString)
This Date constructor only accepts dateStringJulius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com4tag:blogger.com,1999:blog-16210144.post-73991185103407290002011-02-22T17:55:00.000+03:002011-02-22T17:55:35.293+03:00Common mistake in ASP.NET Forms AuthenticationWe are all used to this now...
<configuration>
<system.web>
<authentication mode="Forms">
</authentication>
</system.web>
</configuration>
In ASP.NET Forms authentication, you can allow access to particular users or deny them using the allow and deny Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com3tag:blogger.com,1999:blog-16210144.post-12546866029170136042011-01-04T14:34:00.000+03:002011-01-04T14:34:10.625+03:00VS 2010 SP1 (Beta) and IIS ExpressScottGu has blogged on the VS 2010 SP1 (Beta) and IIS Express, see his article here
Basically Visual Studio 2010 SP1 adds support for IIS Express
IIS Express is a free version of IIS 7.5 that is optimized for developer scenarios:
It’s lightweight and easy to install (less than 5Mb download and a quick install)
It does not require an administrator account to run/debug applications from Visual Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-73323473431772215122010-12-22T17:19:00.001+03:002010-12-22T17:22:08.156+03:00ASP.NET Error Bar ChartThe Error Bar chart type consists of lines with markers that are used to display statistical information about the data displayed in a graph. A series of the Error Bar chart type has three Y values. While these values can be manually assigned to each point, in most cases, the values are calculated from the data present in another series. The order of the Y values is important because each Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com1tag:blogger.com,1999:blog-16210144.post-18075714315281829172010-12-01T18:25:00.000+03:002010-12-01T18:25:42.240+03:00Using osql to do backup/restore and escaping special characters in 'LIKE'Using osql util
Some quick quips to share on Sql Server on using osql command line util to performe backups/restore
backup
osql -E -Sinstancename -q "BACKUP DATABASE [dbname] TO DISK = N'backupfile.bak' WITH NOFORMAT, INIT, NAME = N'dbName Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10"restore
osql -E -Sinstancename -q "RESTORE DATABASE [dbname] FROM Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-28515250846826772362010-11-12T12:36:00.000+03:002010-11-12T12:36:14.707+03:00Visual Studio 2010 Productivity Power ToolsYou can check out the latest VS2010 Productivity Power tools on the visualstudiogallery portal.
I love the Solution Navigator, Searchable and Reference Dialog amongst the other gallery of extensions!Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-45846166932662622722010-11-01T20:06:00.001+03:002010-11-02T19:28:17.861+03:00Why I’m a better software developer than youI came across this article and thought it was good enough to share with you.
What makes one developer better than another? Shouldn’t we all be performing at the same level?...Read more hereJulius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-79522472806233253212010-10-07T19:13:00.000+03:002010-10-07T19:13:18.220+03:00Lady Gaga The Fame and Sql Server 2008 R2I enjoy reading from Brent Ozar.
I liked his review of Sql Server 2008 in his blog where he compared it with Lady Gaga's premier album The Fame and its sophomore.
Go ahead and have a read and enjoy
Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-42926637722307861692010-10-07T16:29:00.001+03:002010-10-07T19:14:00.132+03:00Using TRUNCATE_ONLY in SQL Server 2008After upgrading to SQL Server 2008 from 2005, I got an error with one of my scripts. I am using Sql 2008 SqlExpress 10GB.
This is my T-SQL
BACKUP LOG "pathtomylogfile" WITH TRUNCATE_ONLY;
And I get this error:
Msg 155, Level 15, State 1, Line 1
'TRUNCATE_ONLY' is not a recognized BACKUP option.
So I asked myself if there is an option similar to what 'TRUNCATE_ONLY' was doing in 2005?
I Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-32547494057684143462010-09-18T14:59:00.000+03:002010-09-18T14:59:58.703+03:00Important: ASP.NET Security VulnerabilityPlease read this Microsoft Security Advisory on ScottGu's blog regarding an ASP.NET Security VulnerabilityJulius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com2tag:blogger.com,1999:blog-16210144.post-56760289992967895392010-09-09T15:54:00.003+03:002010-09-24T19:11:17.975+03:00Google InstantGoogle Instant is a new search enhancement that shows results as you type. We are pushing the limits of our technology and infrastructure to help you get better search results, faster. Our key technical insight was that people type slowly, but read quickly, typically taking 300 milliseconds between keystrokes, but only 30 milliseconds (a tenth Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-53319502373562498202010-08-20T19:17:00.001+03:002010-09-24T19:12:01.007+03:00Robert The Grey: I don’t want your stinkin’ code commentsRobert The Grey: I don’t want your stinkin’ code comments: "I just read a fantastic thought experiment being put forward and trialled by Jesse Liberty at the moment. I’ve written this post in support ..."Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-8287288025661616522010-08-18T18:28:00.001+03:002010-09-24T19:12:29.413+03:00Bournemouth Air Festival 19th – 22nd August 2010Incredible air displays, attractions and fantastic evening entertainment – Bournemouth is ready to welcome you to the UK’s biggest free aviation Festival this Thursday, Friday, Saturday and Sunday (19th – 22nd)Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-10888985217840432532010-08-03T16:45:00.000+03:002010-08-03T16:45:01.925+03:00Got DropBox yet?Have you heard of DropBox yet? Don't hesitate to check it out if you haven't. You sync all of your computers via the Dropbox servers, their basic free service gives you 2Gigs of space and works cross-platform (Windows, Mac, Linux)
It works by behaving like a folder under version control that automatically syncs any time something new is added or modified. It takes care of merging and conflicts Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-31260511906138351582010-07-14T16:36:00.000+03:002010-07-14T16:36:41.168+03:00SQL Server Express 2008 now 10GB!In case you are not aware, you now get 10GB with the free edition of SQL Server 2008 Express edition!.Greate news, check out at their official website SQL Server Express 2008Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-85395557687659282822010-07-14T11:34:00.000+03:002010-07-14T11:34:39.433+03:00C# extension method similar to Sql's IN operatorConsider the code snippet belowif(a == x || a == y || a == z)We can re-write this expression as:
Using array's contains
if( new [] {x,y,z}.Contains(a)) Using a similar syntax for the SQL's IN operator by using extension
public bool IsIn(this T obj, params T[] collection) { return collection.Contains(obj);}And invoke asif(a.IsIn(b, c, d)) { ... }
Read more at StackoverflowJulius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-18912725940929316812010-07-07T13:34:00.000+03:002010-07-07T13:34:58.017+03:00Find the Port a Connection is Using in Sql ServerSELECT c.session_id, c.local_tcp_port, s.login_name, s.host_name, s.program_name
FROM sys.dm_exec_connections AS c INNER JOIN
sys.dm_exec_sessions AS s on c.session_id = s.session_id
WHERE c.local_tcp_port <> 1433
I found this very useful when monitoring external access to your Sql Server instance.
The original post was Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-72882792064665717482010-06-11T12:12:00.000+03:002010-06-11T12:12:21.117+03:00Fifa World cup 2010 kicks off today in South AfricaFifa World cup 2010 kicks off today in South Africa. Yes, it is the first time Africa is hosting the tournament.Looking forward to an entertaining month ahead and may the best team win.Talk of favourites in this year's event, and names like Spain, Argentina, and England and of course the perennial favourites Brazil come up.
At our office, we did a mini Odds/Bets and I was lucky to bet on the Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-89120067823465026062010-06-08T16:45:00.000+03:002010-06-08T16:45:50.897+03:00Use Cookie-free Domains for ComponentsUse Cookie-free Domains for ComponentsThis is an excerpt from Yahoo Best Practices for Speeding Up Your Web Site When the browser makes a request for a static image and sends cookies together with the request, the server doesn't have any use for those cookies. So they only create network traffic for no good reason. You should make sure static components are requested with cookie-free Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0tag:blogger.com,1999:blog-16210144.post-58929720112151871492010-06-04T18:16:00.000+03:002010-06-04T18:16:07.594+03:00Asp.net - Invalid postback or callback argument. Event validation is enabled using ‘’Asp.net - Invalid postback or callback argument. Event validation is enabled using ‘’
This is a common Asp.Net error when updating List Box items on the client side.
I asked this question on stackoverflow.com (Click here).
Just reflecting on how many views people have had on this question, it seems to be a common issue most Asp.Net developers encounter.Julius Ahttp://www.blogger.com/profile/00735231155775969553noreply@blogger.com0