Saturday, 15 September 2012

Add Serial no in crystal report without coding

Adding a serial number in grouping without any code. I have placed the step by step screenshots which will explain easily how to do it.
 
1) Add a new field in Running Total Fields in Field Explorer
 


Give a proper name to your Running total name. For example I have choosen here RTotal0. Now categorize based on which field in database you want to summarize it. Next is as we want serial number select count. If you want your serial number to start again from the start when the value in the group changes then select on change of group and specify the grouping name else keep the default value.



 Smaple Preview of the Design View of Report where I Have added SRNo column at the start in grouping section.
 

Thursday, 6 September 2012

What is the difference between Convert.toString and .toString() method ?

Just to give an understanding of what the above question means seethe below code.

 int i =0;

MessageBox.Show(i.ToString());

 MessageBox.Show(Convert.ToString(i));



We can convert the integer "i" using "i.ToString()" or "Convert.ToString" so what’s the difference.
The basic difference between them is "Convert" function handles NULLS while "i.ToString()" does not it will throw a NULL reference exception error. So as good coding practice using "convert" is always safe.

Wednesday, 5 September 2012

system.int64 and system.int32 Difference

system.int64 and system.int32

Basic :
  • int is an alias for Int32
  • long is an alias for Int64

More :

On both 32-bit and 64-bit machines:
  • long is 64-bit, it's a synonym for System.Int64.
  • int is 32-bit, it's a synonym for System.Int32.

Monday, 3 September 2012

500.19 Internal Server Error



Solution:
1. Add IIS_IUSRS with Read permission on files in the folder
              2. Change IIS authentication method to BasicAuthentication

              3. refresh the website. It will work

This problems occurs because your application can not access and read web.config file.
Make the file accessible to IIS_IUSRS group. Just right click web.config and click properties, under security tab, add IIS_IUSRS.
So what is this IIS_IUSRS thing?
Your web site is like an exe file. Just like any exe file, it should be started by a user and it runs according to permissions assigned to that user.
When your site is started in IIS, Application Pool of your web site is associated with a user (Network Services, Local System, Etc. ...) (and can be changed in IIS)
So when you say IIS_IUSRS, it means any user (Network Services, Local System, Etc. ...) that your site is running as.
And as @Seph mentioned in comment below: If your computer is on a domain, remember that IIS_IUSRS group is a local group.