Thursday, 20 February 2014

ASP.NET Clear the GridView data on specific condition

ASP.NET Clear the GridView data on specific condition

When there are no data found for user search criteria then we want to clear the previous gridview data and display "No record found" message to user.

This can be achieved by following line of code:
Set the DataSource = null and bind this to your gridview.

if (lblError.Visible == false)
                    if (dvCustomerRecords.Count > 0)
                        gvCustomer.DataSource = dvCustomerRecords;
                        gvCustomer.DataSource = null;
                        lblError.Visible = true;
                        lblError.Text = "No Record : No record found for specified search criteria!";


Thursday, 13 February 2014

Creating & Configuring Application pool for Website/WCF service in IIS

Creating & Configuring a new Application pool for Website/WCF service in IIS

   1. Create and Deploy your web application/WCf service to IIS.
   2.  Click “Application Pools” à right Click mouse, select “Add Application Pool”

   3. Type the name of Application pool, Select the required framework version and Managed Pipeline Mode.
Click OK. This will create a new application pool.

4.For performance and timeout related setting, please go to “Advance Setting” option of Application pool. It’s recommended to update advance setting of application pool carefully. As there are many setting which can affect performance of your application. 

5. Once you create the application pool as per your requirement. Then go to WCF/Web Application which need to be configured to run under this application pool.

6.  Go to “Manage Application” à “Advance setting”

7. Go to “Application Pool”. Click Browse option next to current application pool name. It will open a new popup window. Select the required application pool. For this demo I am selecting the newly created application pool “WCFWebAppPool”.

8. Click “OK”. Now your application will run under newly created application pool.

Wednesday, 12 February 2014

WCF throttling (Resource Utilization/ Load Balance) configuration

WCF throttling (Resource Utilization/ Load Balance) :
Limit how many instances or sessions are created at the application level for better utilization of resource and memory.

Resource Utilization : With the implementation of throttling, we can properly utilize the available resource like Memory, threads. Each resource could be managed at its reasonable limit to avoid very high utilization of any specific resource.

Load Balance :  Application should work under  balanced load. If we execute anything concurrently then there could lot of performance and load balancing related problem will occur.

WCF throttling allow us to manage our resource utilization and balancing the load as per our processor/RAM availability.
We have  following three property which allow us to control WCF service behavior:
      WCF throttling                  -WCF behavior setting  config level
a.       maxConcurrentCalls  - number of messages that currently process across a ServiceHost (Default: (depends on Framework version) * processor count)
b.      maxConcurrentSessions - number of sessions a ServiceHost object can accept, only the channels below the limit are active   (Default: 16 * processor count)
c.       maxConcurrentInstances - number of InstanceContext objects that execute at one time across a ServiceHost (Default: maxConcurrentSessions +  MaxConcurrentCalls)

·    MaxConcurrentSessions (default: 10)
·    MaxConcurrentCalls (default: 16)
·    MaxConcurrentInstances (default: 26)

Default setting for WCF 4.O for scalability according to the Web Server:
MaxConcurrentSessions: default is 100 * ProcessorCount
MaxConcurrentCalls: default is 16 * ProcessorCount
MaxConcurrentInstances: default is the total of the above two, which follows the same pattern as before. (Default: maxConcurrentSessions +  MaxConcurrentCalls)

This setting can be defined at config  file @ service Behaviors level
        <behavior  name="Throttled">

Thursday, 6 February 2014

BizTalk Error: “Loading property information list by namespace failed or property not found in the list”

BizTalk side-by-side versioning error: “Loading property information list by namespace failed or property not found in the list”

Cause for this error is  deploying same schema with different version, One deployed version of schema allow other schema to be Inactive.

exec bt_LoadPropertyInfoByNamespace @nvcNamespace=N'http://Domain.EAI.Solution'
exec bt_LoadPropertyInfoByNamespace @nvcNamespace=N'http://Domain.EAI.Solution/009'

the above query should return the containing msgtyep and Property class,

select *
FROM bt_XMLShare
WHERE target_namespace like N'http://Domain.EAI.Solution' AND active = 1

Check if the Activate flag =1 or 0. 1- Means the schema is active 

If it’s not active, Please redeploy the schema in correct order. This should resolve the  ‘loading property error’