few Days back i posted about SSIS package . as per our discussion with our architect we have decided to to go with SSIS package.
when developing a small application with SSIS i noticed if we have multiple Tasks coming from single TASK then all those execute in parallel and if i am not wrong that is parallel processing in SSIS package by default.
The task which has many connecting lines coming to it waits for all tasks to finish their execution.
When those tasks are executing in parallel in SSIS package if any of task fail the we can have seprate exception handling for that particular task.
so i guess we have parallel processing of task by default in SSIS package .
Please let me know you suggestions .
Thursday, 2 May 2013
Tuesday, 30 April 2013
Uploading file directly to database using mvc
hey friends back again with MVC .
we have a portal where use can upload a file and from that file MVC application will get data and
currently we have a requirement where we have to Upload the file that will be in .xls excel format.
we implemented it Upload the file and save it on server then from that location we can read it in byte stream and save into database.
but the problem is our architect is not giving the write permission on server :(:(
so do we have any solution where we can directly save the content to database and read it from there .
if yes please update in comments.
Found one link
http://forums.asp.net/t/1808216.aspx/1?Help+On+File+Upload+to+database+in+MVC
i have not yet tested it hope it works .
we have a portal where use can upload a file and from that file MVC application will get data and
currently we have a requirement where we have to Upload the file that will be in .xls excel format.
we implemented it Upload the file and save it on server then from that location we can read it in byte stream and save into database.
but the problem is our architect is not giving the write permission on server :(:(
so do we have any solution where we can directly save the content to database and read it from there .
if yes please update in comments.
Found one link
http://forums.asp.net/t/1808216.aspx/1?Help+On+File+Upload+to+database+in+MVC
i have not yet tested it hope it works .
Monday, 29 April 2013
Do's and Dont's for WCF service
we always start on performance after completing the development of WCF service. but there are some points which we should remember to have hige performance WCF service.
below are some points which can help you in increasing the performance of WCF service :
- choose carefully between singleton instance and per call instance.
- if you have like 100 users hitting your wcf service simultaneously use per call instance as this will give you best result.
- problem with singleton instance is with concurrency. we faced this issue in one of our wcf service.
- response time decreased from 120 ms to 80ms :O wooow
- use tracing to find out which method is taking maximum time and try to minimize that.
- Make sure to use web service throttling. you can find a lot of articles on web service throttling, but in my case it didn't work as expected though it is very useful.
- try to minimize the database hits . use caching to get configuration . surely this is going the increase wcf service's performance a lot.
- if you are using logging or trying to log the request and response message do it in a sync way.
- always free the objects as soon those are not required .
Sunday, 28 April 2013
SSIS Package
Recently we got a requirement of saving data from one server to another server . both server has SQL server 2012 . data will not be not that huge but we are expecting 10-12k records everyday.
This data will be transferred once in a day.
so after looking other options like creating a job in C# and sending data in xml as extarct or using big data and SSIS we have finalized SSIS . I am very new to SSIS dont know much about SSIS .
so i just started working with SSIS package so whatever will be the questions or learnings i will be posting.
meanwhile i would like to whether its a correct decision to use SSIS in this scenario ??
This data will be transferred once in a day.
so after looking other options like creating a job in C# and sending data in xml as extarct or using big data and SSIS we have finalized SSIS . I am very new to SSIS dont know much about SSIS .
so i just started working with SSIS package so whatever will be the questions or learnings i will be posting.
meanwhile i would like to whether its a correct decision to use SSIS in this scenario ??
Thursday, 18 April 2013
Improving WCF service performance
we discussed about how to improve the WCF service after a lot of research we found that in our service we have around
1) 10-12 database calls
2) 2 service calls.
so it was taking around 300ms. :O
huuuuuhhh
after implementing webservice throttling and what we say having instance per call we are still not able to to get the desired result.
currently we are planning to convert those 10-12 db hit into single db call and are plnning to to call other service in async way .
any other help will be greatly appreciated .
1) 10-12 database calls
2) 2 service calls.
so it was taking around 300ms. :O
huuuuuhhh
after implementing webservice throttling and what we say having instance per call we are still not able to to get the desired result.
currently we are planning to convert those 10-12 db hit into single db call and are plnning to to call other service in async way .
any other help will be greatly appreciated .
Wednesday, 10 April 2013
Use the PerCall or PerSession instance context mode
Use the PerCall or PerSession instance context mode
The InstanceContextMode also plays a significant role in the overall performance of your service, and of the three options available to you – PerCall, PerSession and Singleton – you should consider PerCall or PerSession for a highly scalable WCF service.Whilst the PerCall instance context mode is generally regarded as the most scalable option it does carry with it the need to create a instance of your class for each request and you need to ensure that 1) you have a parameterless constructor, and 2) this constructor should do as little as possible. If there are any significant steps that need to be performed, such as loading some reference data, you should avoid doing these in the parameterless constructor so they aren’t performed for each request:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
| [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]public class MyService : IMyService{ public MyService() { ReferenceData = LoadReferenceData(); // will be called for EACH request… } public MyReferenceData ReferenceData { get; private set; } …}[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]public class MyService2 : IMyService{ // called the first time the reference data is used and shared across all instances private static MyReferenceData ReferenceData = LoadReferenceData(); public MyService2() { // ideal constructor which does nothing } …} |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]public class MyServiceWrapper : IMyServiceWrapper{ // get the underlying service from the container private static IMyService MyService = _container.Resolve<IMyService>(); public MyServiceWrapper() { // parameterless constructor which does nothing, so easy to constructor } public void DoSomething() { MyService.DoSomething(); }}// dummy interface to ensure the wrapper has the same methods as the underlying service// but helps to avoid confusionpublic interface IMyServiceWrapper : IMyService{} |
If your service is session dependant then you should definitely go with PerSession, but beware, if the channel does not create a session your service will behave as if it was a PerCall service.
Increase the number of idle IO threads in the thread pool
Perhaps the most overlooked aspect when it comes to increasing concurrency of a WCF service. If you’ve set your service to use PerCall or PerSession instance context mode and upped the throttling settings, but are still not getting the response times you’re looking for, then it’s worth investigating whether the calls are being queued because there is not enough IO threads in the ThreadPool to handle the requests.You can establish whether or not the requests are actually taking longer to process under load (as opposed to being queued at a service level) either by profiling locally or using some form of run-time logging (I wrote a LogExecutionTime attribute which might come in handy). If the calls aren’t taking longer to process and you’re not seeing very high CPU utilisation then the increase in response time is likely a result of the request being queued whilst WCF waits for a new IO thread to be made available to handle the request.
WCF uses the IO threads from the ThreadPool to handle requests and by default, the ThreadPool keeps one IO thread around for each CPU. So on a single core machine that means you only have ONE available IO thread to start with, and when more IO threads are needed they’re created by the ThreadPool with a delay:
“The thread pool maintains a minimum number of idle threads. For worker threads, the default value of this minimum is the number of processors. The GetMinThreads method obtains the minimum numbers of idle worker and I/O completion threads.However, as WenLong Dong pointed out in his blog (see references section), raising the MinIOThreads setting in the ThreadPool doesn’t work as you’d expect in .Net 3.5 because of a known issue with the ThreadPool which has since been fixed in .Net 4. So if you’re still running .Net 3.5 like most of us, then you will need to go and grab the hotfix from here:
When all thread pool threads have been assigned to tasks, the thread pool does not immediately begin creating new idle threads. To avoid unnecessarily allocating stack space for threads, it creates new idle threads at intervals. The interval is currently half a second, although it could change in future versions of the .NET Framework.
If an application is subject to bursts of activity in which large numbers of thread pool tasks are queued, use the SetMinThreads method to increase the minimum number of idle threads. Otherwise, the built-in delay in creating new idle threads could cause a bottleneck.”
http://support.microsoft.com/kb/976898
Parting thoughts:
Performance tuning isn’t an exact science, and you have to make a case by case judgement on how best to approach your performance issues. Encouraging greater concurrency is just one of the ways you can improve performance, but it’s by no means a silver bullet! In fact, if you go too far down the concurrency route you could find yourself facing a number of problems:- 100% CPU – excessive number of concurrent threads can max out your CPU and a lot of CPU time can be wasted on context switching whilst your service becomes less responsive.
- DOS attack – same as above, but intended by a would be attacker.
- OutOfMemoryException – if your service is returning a large set of data from database/committing large amount of database writes within a transaction, it’s not unthinkable that you might run into the dreaded OutOfMemoryException given that: 1) in practice you only have a per process cap of around 1.2 ~ 1.5GB of memory and each active thread is allocated a 1MB of memory space (regardless of how much it actually uses); 2) each concurrent call performs large number of object creations which takes up available memory space until they’re garbage collected 3) writing to the Database within a transaction adds to the transaction log which also eats into the available memory.
References:
WenLong Dong’s post on WCF responses being slow and SetMinThreads does not workWenLong Dong’s post on WCF request throttling and Server Scalability
WenLong Dong’s post on WCF becoming slow after being idle for 15 seconds
Scott Weinstein’s post on creating high performance WCF services
Dan Rigsby’s post on throttling WCF service and maintaining scalability
WCF Service Performance, is it all about calls per second?
Non-Functional Requirements - Performance
Of all the non-functional or technical requirements,
performance is the one that seems to get the most attention. I
personally know developers who will spend hours and hundreds of dollars
of their customers money in trying to shave milliseconds off a routine
in a WCF Service.
In this hub I will dispel some of the common myths surrounding performance using the WCF (Windows Communication Foundation) platform, and provide some metrics I have captured for the WCF services in live production systems. I remember starting out using WCF and not being able to find a single resource that would give me any actual real data to compare my benchmarks against.
I am now into my third major implementation using the WCF service stack, by that I mean big projects at enterprise clients with many interdependent services. The production environments are real, load balanced and representative.
The model I use to build service orientated software utilizes the Manager, Gateway, Engine pattern (GME), thus the metrics are affected by a combination of technology and pattern.
For transactional calls (insert, update, delete) with real business logic behind it, between 25 -40 calls per second.
For select type calls (no transaction) it hovers around 90 - 120 calls per second.
If did did some work on optimizing the code and utilizing all the cores of the server by going parallel where it made sense to do so, I could get more, but who has time for that, this is adequte.
I think of scaling in terms of virtual server instances, so if I want more, I just add another node to the load balancer and get another instance up.
In this hub I will dispel some of the common myths surrounding performance using the WCF (Windows Communication Foundation) platform, and provide some metrics I have captured for the WCF services in live production systems. I remember starting out using WCF and not being able to find a single resource that would give me any actual real data to compare my benchmarks against.
I am now into my third major implementation using the WCF service stack, by that I mean big projects at enterprise clients with many interdependent services. The production environments are real, load balanced and representative.
The model I use to build service orientated software utilizes the Manager, Gateway, Engine pattern (GME), thus the metrics are affected by a combination of technology and pattern.
Manager, Gateway, Engine Pattern
What is Performance?
Performance is an indication of the responsiveness of a system to execute any action within a given interval of time.
The performance of any software is dependent on many factors, most of which have nothing to do with the framework and technology used to build it. Even the most performant software can still have a method that causes an endless loop or a “live lock” that causes a client to wait.A poor server or network could also be the cause of a loss of performance.
The issue then is to ensure that neither the model nor the technology is the cause
of any unacceptable loss of performance.
The performance of any software is dependent on many factors, most of which have nothing to do with the framework and technology used to build it. Even the most performant software can still have a method that causes an endless loop or a “live lock” that causes a client to wait.A poor server or network could also be the cause of a loss of performance.
The issue then is to ensure that neither the model nor the technology is the cause
of any unacceptable loss of performance.
Technology - WCF, Model - GME
The
technology in this instance is WCF, the model advocates that every
class is a service in order to leverage the built in plumbing that comes
with WCF, but one often hears the question, what about performance?
This is the wrong question to ask, as in reality nobody except developers even cares about performance as long as performance is adequate.
So the actual question is, is the performance adequate? So let’s weigh it all up with all classes as WCF services we automatically benefit from:
This is the wrong question to ask, as in reality nobody except developers even cares about performance as long as performance is adequate.
So the actual question is, is the performance adequate? So let’s weigh it all up with all classes as WCF services we automatically benefit from:
WCF Benefits
1. Encrypted calls
|
2. Authentication
|
3. Identity propagation
|
4. Authorization
|
5. Security audit
|
6. Transactional propagation
|
7. Transactional voting
|
8. Calls timeout
|
9. Reliability
|
10. Tracing and logging
|
11. Profiling and instrumentation
|
12. Instance management
|
13. Durability
|
14. Error masking
|
15. Fault isolation
|
16. Channel faulting
|
17. Buffering and throttling
|
18. Data version tolerance
|
19. Synchronization
|
20. Remotability
|
21. Queuing
|
22. Relay
|
23. Discovery
|
WCF Benefits
So what about performance
So
what about performance, WCF is not free, but it is adequate for most
applications, most applications will never notice it. Raw WCF with a
single client calling to a single service with no work in it on a laptop
provides some 10,000 calls per second, raw C# offers some 300,000 calls
per second.
To put the calls per second thing into perspective I would imagine that Amazon runs at about 150 calls per second.
But raw WCF offers no value, in a real system with every aspect of WCF enabled, WCF can manage 100 calls per second on a laptop; in contrast, a C# application with all the equivalent aspects created as bespoke code and enabled manages a maximum of 10 calls per second.
Strange you may think, what has happened?
The WCF aspects underwent years of rigorous testing by some of the most devious minds in the industry and has been optimized and performance tweaked.
So if you care about performance you have to use WCF as all its aspects have been performance tested against hundreds of different scenarios and perform better than the components you have written and only tested against the one or two scenarios that you knew about.
To put the calls per second thing into perspective I would imagine that Amazon runs at about 150 calls per second.
But raw WCF offers no value, in a real system with every aspect of WCF enabled, WCF can manage 100 calls per second on a laptop; in contrast, a C# application with all the equivalent aspects created as bespoke code and enabled manages a maximum of 10 calls per second.
Strange you may think, what has happened?
The WCF aspects underwent years of rigorous testing by some of the most devious minds in the industry and has been optimized and performance tweaked.
So if you care about performance you have to use WCF as all its aspects have been performance tested against hundreds of different scenarios and perform better than the components you have written and only tested against the one or two scenarios that you knew about.
Cost of WCF
There
is a cost to using every WCF aspect; every aspect will cause a
certain degradation in performance, this is summed in the table below.
Cost of WCF Aspects
ASPECT
|
COST (%)
|
|---|---|
Encoding
|
0
|
Process Boundry
|
0
|
Authorization
|
0
|
Authentication
|
0
|
Instancing mode
|
0
|
Reliability
|
10
|
Performance counters
|
25
|
Transactions
|
66
|
Message Protection
|
85
|
Logging and Tracing
|
95
|
source: J Lowy
Security is not an option
I
don`t know about you, but in my world security is not an option, also
service guidelines tell us that services should be secure, so if message
protection is mandatory, then you have security enabled and you should
then also enable everything else as it will not affect your
performance as you have already taken the hit for security.
Only logging and tracing becomes optional, and that can always be turned on and off via configuration files if you need it.
Only logging and tracing becomes optional, and that can always be turned on and off via configuration files if you need it.
The Metrics
So without boring you, in my tests, with every aspect of WCF turned on in a production environment, calling from a test harness with multiple calls on multiple threads, I typically get the following:For transactional calls (insert, update, delete) with real business logic behind it, between 25 -40 calls per second.
For select type calls (no transaction) it hovers around 90 - 120 calls per second.
If did did some work on optimizing the code and utilizing all the cores of the server by going parallel where it made sense to do so, I could get more, but who has time for that, this is adequte.
I think of scaling in terms of virtual server instances, so if I want more, I just add another node to the load balancer and get another instance up.
Tuesday, 9 April 2013
Improving WCF Service Performance
This article is from MSDN. i was surprised after reading it.hope u too r surprised after reading
WCF services expose numerous configuration parameters that affect performance. This topic provides general guidance for setting optimal values for these configuration parameters to improve performance of WCF services.
WCF services expose numerous configuration parameters that affect performance. This topic provides general guidance for setting optimal values for these configuration parameters to improve performance of WCF services.
Implement
serviceThrottling behavior for backend WCF services. Service throttling
allows you to even out the load on your backend WCF servers and to
enforce resource allocation. serviceThrottling behavior for backend WCF
services is configured by modifying the values for the maxConcurrentCalls, maxConcurrentSessions, and maxConcurrentInstances parameters in the config file for the WCF service. Set maxConcurrentCalls, maxConcurrentSessions, and maxConcurrentInstances to a value greater than 16 * the number of CPUs or CPU cores. For example, on a computer with 8 CPU cores, set maxConcurrentCalls, maxConcurrentSessions, and maxConcurrentInstances to a value greater than 128 (16 * 8 = 128) as follows:
<serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="200" maxConcurrentInstances="200" />
The NetTcpBinding.ListenBacklog property controls the maximum number of queued connection requests that can be pending for a Web service. The NetTcpBinding.MaxConnections
property controls the maximum number of connections to be pooled for
subsequent reuse on the client and the maximum number of connections
allowed to be pending dispatch on the server. Each of these properties
uses a default value of 10 which may be suboptimal, especially for
document processing scenarios that require high throughput.
Consider increasing the default value of these properties for high-throughput, document-processing scenarios that use WCF services which implement the netTcpBinding binding class.
In the following example, both the listenBacklog and maxConnections parameters are set to a value of “200”.
For more information about the NetTcpBinding.ListenBacklog property, see NetTcpBinding.ListenBacklog Property (http://go.microsoft.com/fwlink/?LinkId=157752) on MSDN.
For more information about the NetTcpBinding.MaxConnections property, see NetTcpBinding.MaxConnections Property (http://go.microsoft.com/fwlink/?LinkID=157751) on MSDN.
Consider increasing the default value of these properties for high-throughput, document-processing scenarios that use WCF services which implement the netTcpBinding binding class.
In the following example, both the listenBacklog and maxConnections parameters are set to a value of “200”.
<netTcpBinding>
<binding name="netTcpBinding"
closeTimeout="00:10:00"
openTimeout="00:10:00"
receiveTimeout="00:10:00"
sendTimeout="00:10:00"
transactionFlow="false"
transferMode="Buffered"
transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard"
listenBacklog="200"
maxBufferPoolSize="1048576"
maxBufferSize="10485760"
maxConnections="200"
maxReceivedMessageSize="10485760">
<readerQuotas
maxDepth="32"
maxStringContentLength="8192"
maxArrayLength="16384"
maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
<reliableSession
ordered="true"
inactivityTimeout="00:10:00"
enabled="false" />
<security mode="None">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
</netTcpBinding>
For more information about the NetTcpBinding.MaxConnections property, see NetTcpBinding.MaxConnections Property (http://go.microsoft.com/fwlink/?LinkID=157751) on MSDN.
By
default, several ASP.NET httpModules are defined in the Request
Pipeline in IIS 6.0 and in the Classic or Integrated Pipeline in IIS
7.0. These components intercept and process all incoming requests. The
default modules are defined in the web.config file contained in the
%windir%\Microsoft.NET\Framework\v2.0.50727\CONFIG folder for 32-bit
ASP.NET applications and in the
%windir%\Microsoft.NET\Framework64\v2.0.50727\CONFIG folder for 64-bit
ASP.NET applications, as shown by the following snippet.
In most scenarios it is not necessary to load all of these
modules. Therefore, it is possible to improve performance by eliminating
the following httpModules when running WCF Web services:
<httpModules> <add name="OutputCache" type="System.Web.Caching.OutputCacheModule"/> <add name="Session" type="System.Web.SessionState.SessionStateModule"/> <add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule"/> <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule"/> <add name="PassportAuthentication" type="System.Web.Security.PassportAuthenticationModule"/> <add name="RoleManager" type="System.Web.Security.RoleManagerModule"/> <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule"/> <add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule"/> <add name="AnonymousIdentification" type="System.Web.Security.AnonymousIdentificationModule"/> <add name="Profile" type="System.Web.Profile.ProfileModule"/> <add name="ErrorHandlerModule" type="System.Web.Mobile.ErrorHandlerModule, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> <add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> </httpModules>
- Session
- WindowsAuthentication
- FormsAuthentication
- PassportAuthentication
- RoleManager
- AnonymousIdentification
- Profile
The WCF Module/Handler Registration Tool is available for download at http://go.microsoft.com/fwlink/?LinkId=157593
(http://go.microsoft.com/fwlink/?LinkId=157593). This utility can be
used to install, list, or configure the following WCF modules:
- WCF Synchronous HTTP module and handler
- WCF Asynchronous HTTP module and handler
- WCF HTTP module and handler
Concepts
Optimizing BizTalk Server WCF Adapter PerformanceThursday, 21 March 2013
Designing a new DataBase
hi ,
everyone i am developer , recently i started working on a new database design. i was getting a lot of suggestion from varios blogs .
so i decided to list them down :
When you start your database design the first thing to analyze is the nature of the application you are designing for, is it Transactional or Analytical. You will find many developers by default applying normalization rules without thinking about the nature of the application and then later getting into performance and customization issues. As said, there are two kinds of applications: transaction based and analytical based, let’s understand what these types are.
Transactional: In this kind of application, your end user is more interested in CRUD, i.e., creating, reading, updating, and deleting records. The official name for such a kind of database is OLTP.
Analytical: In these kinds of applications your end user is more interested in analysis, reporting, forecasting, etc. These kinds of databases have a less number of inserts and updates. The main intention here is to fetch and analyze data as fast as possible. The official name for such a kind of database is OLAP.
In other words if you think inserts, updates, and deletes are more prominent then go for
a normalized table design, else create a flat denormalized database structure.
Below is a simple diagram which shows how the names and address in the left hand side are a simple normalized table and by applying a denormalized structure how we have created a flat table structure.
For instance you can see the below table which has student names; if you ever want to query student names having “Koirala” and not “Harisingh”, you can imagine what kind of a query you will end up with.
So the better approach would be to break this field into further logical pieces so that we can write clean and optimal queries.
everyone i am developer , recently i started working on a new database design. i was getting a lot of suggestion from varios blogs .
so i decided to list them down :
When you start your database design the first thing to analyze is the nature of the application you are designing for, is it Transactional or Analytical. You will find many developers by default applying normalization rules without thinking about the nature of the application and then later getting into performance and customization issues. As said, there are two kinds of applications: transaction based and analytical based, let’s understand what these types are.
Transactional: In this kind of application, your end user is more interested in CRUD, i.e., creating, reading, updating, and deleting records. The official name for such a kind of database is OLTP.
Analytical: In these kinds of applications your end user is more interested in analysis, reporting, forecasting, etc. These kinds of databases have a less number of inserts and updates. The main intention here is to fetch and analyze data as fast as possible. The official name for such a kind of database is OLAP.
Below is a simple diagram which shows how the names and address in the left hand side are a simple normalized table and by applying a denormalized structure how we have created a flat table structure.
Rule 2: Break your data into logical pieces, make life simpler
This rule is actually the first rule from 1st normal form. One of the signs of violation of this rule is if your queries are using too many string parsing functions like substring, charindex, etc., then probably this rule needs to be applied.For instance you can see the below table which has student names; if you ever want to query student names having “Koirala” and not “Harisingh”, you can imagine what kind of a query you will end up with.
So the better approach would be to break this field into further logical pieces so that we can write clean and optimal queries.
Wednesday, 20 March 2013
SharePoint Basics
SharePoint is a browser based web application developed by Microsoft that enables users within an organization to work together, collaborate, more efficiently through its vast number of features.
Some of the features include the followin. Document Management, Web Content Management, Business Process Management (Workflows), Enterprise Search, Business Intelligence (Dashboards, Reports), Electronic Forms (InfoPath), Social Networking
SharePoint (2010) Versions Available
1. SharePoint Foundation (Free version, known as WSS in 2007.
Mainly Provides Document Management)
2. SharePoint Standard Edition
3. SharePoint Enterprise Edition
Click the below link for more
details of the SharePoint Versions
WSS stands for Windows SharePoint Services. It is a core framework on which MOSS works. WSS features are: Wiki, Blogs site, Document management, Server Farm.
MOSS stands for Microsoft Office SharePoint Server. It is the part of SharePoint which gives more functionality with WSS. MOSS features are:
Mysite, Search Services, Audience Targeting, Excel Services, Form Services.
A library is a component in SharePoint that stores files (documents) and a list
is a component in SharePoint that stores rows of information. In
Library you can create core document like Word, Excel, and PowerPoint.
But in List You cannot create document, instead of that you can attach
document in a particular List.
Document Library contains core document such as, MS word, Excel, PowerPoint. But Form library contains document in XML form Such as InfoPath form.
Sites available in SharePoint are Wiki Sites, Blogs Site, Meeting Sites, Team Sites, and Blank Sites etc.
Site Definitions
are the foundations on which all sites and user templates are built.
Site Definition is collection ox XML and .aspx file. Site Definitions
are predefined components needs to be included when a site was created
in SharePoint server.
Webparts are
smallest component in SharePoint. Web parts are used to give more
functionality to the page. In SharePoint we have custom web part as well
as readymade 3rd party web part. You can create a custom web part by
using visual studio.
SharePoint object model hierarchy:
The Following is the order of the SharePoint Object Model .
- SPFarm
- SPSite
- SPWeb
- SPList
- SPListItem
· Farm-
is a collection of one or more SharePoint server which having a single
configuration database. A farm will contain multiple web applications.
· Web Application-
is always created for Central Administration and at least one web
application will be created for the SharePoint intranet, extranet or
internet site. A web application is where you implement and maintain
authentication.
· Site Collection- Site collection is the collection of sites and workspaces which create a hierarchy
· Sites-Site is the container of contents, contents are in the form of List and Library
· Pages
User Permission levels:
Design: Persons can read, modify, delete records and also modify their views
Contribute: Persons can read, modify, delete records. (This is widely used permission level)
Read: Persons can view the records.Sharepoint Designer
Visual Studio
Silverlight/Microsoft expression blend
Pages Available are…
Site Pages: These
are pages that supports user customization by designing tools e.g.
SharePoint designer. Some site pages are default.aspx, default.master
Application Pages:
Those pages which does not support user customization. These pages are
found in virtual -layouts directory. Application pages can be used with
any sites or site collection on same server.
You may find application pages at this location:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS
A content type
is a reusable thing provided by WSS. Content type defines the column
for an item in a library or list and same can be used for any library or
list in that SharePoint application.
For e.g. you are creating a list for
leave application then if you are creating column for HR department, IT
department then it does not makes any sense.
So used content type where you can
create your own column or site column (Given by SharePoint) and you can
use this content type with any list or library.
Business Data Catalogue: It is a middleware for your SharePoint site and back end data such as SAP, Siebel and any other Line of Business application.
In BDC you cannot modify data from your SharePoint list. It will be available to your site in read only.
In SharePoint 2010 it is named as BCS (Business Connectivity Services). BCS is two way, i.e. Data can be edit from SharePoint list as well from the back end data base.
Workspace is more specific to a site for e.g. you want to create annual report
CAML stands
for Collaborative application markup languages. It is in xml form. And
it can be sued to retrieve the data from SharePoint list as well to
update and insert.
Stsadm command is used to perform all administrative work like backup, restore, installing feature, adding web part to site etc.
Using the STSADM tool the following commands can be done:
Backup command:
stsadm -o backup -url http://moss:1985/ -filename c:\mysite.bak
To restore:
Create one blank Site collection on same server with any port number e.g. 1986.
stsadm -o restore -url http://moss:1986/ -filename c:\mysite.bak
Simple Implementation of MVC Cascading Ajax Drop Down
Simple Implementation of MVC Cascading Ajax Drop Down
Lets start! Lets say you have the following structure below.
You need to have models for each of them
Now you need a controller to perform all of the operations, Lets call it CascadingDropDown.cs, we need 3 Actions Results one for the Index which will Load the page and populate the Category DropDown, Select Category to populate Sub Category Drop Down and Select Sub Category to populate Products Drop Down. If you notice the name might be confusing that is because it is named after an Action Result not action to perform, which means what Action was invoked for this to happen. Below is a sample code.
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace MvcApplication1.Controllers { using Models; public class CascadingDropDownController : Controller { public ActionResult Index() { ProductCatalog productCatalog = new ProductCatalog(); productCatalog.Categories = ProductCatalog.GetCategories(); return View(productCatalog); } [HttpPost] public ActionResult SelectCategory(int? selectedCategoryId) { ProductCatalog productCatalog = new ProductCatalog(); productCatalog.SubCategories = new List<SubCategory>(); if (selectedCategoryId.HasValue) { productCatalog.SubCategories = (from s in ProductCatalog.GetSubCategories() where s.CategoryId == selectedCategoryId orderby s.Name select s).ToList(); } return PartialView("SubCategoriesUserControl", productCatalog); } [HttpPost] public ActionResult SelectSubCategory(int? selectedSubCategoryId) { ProductCatalog productCatalog = new ProductCatalog(); productCatalog.Products = new List<Product>(); if (selectedSubCategoryId.HasValue) { productCatalog.Products = (from s in ProductCatalog.GetProducts() where s.SubCategoryId == selectedSubCategoryId orderby s.Name select s).ToList(); } return PartialView("ProductsUserControl", productCatalog); } } }Take note we use partial view on the SelectCategory and SelectSubCategory as we will send a partial view to the response. While on the Index we need the full rendering to the response. Now you have your controller we need to create those views. We need 1 view for Index and 3 partial views for the 3 dropdowns.
Now lets create the Index view, all you have to do is to right-click on the Index method on your controller then you can start coding. This view will display all of the dropdowns.
Index.cshtml
@model MvcApplication1.Models.ProductCatalog @{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Layout.cshtml"; } <table cellpadding="0" cellspacing="4" border="0"> <tr> <td>Category </td> <td> :</td> <td>@Html.Partial("CategoriesUserControl", Model)</td> </tr> <tr> <td>Sub - Category </td> <td> :</td> <td><div id="SubCategories">@Html.Partial("SubCategoriesUserControl", Model)</div></td> </tr> <tr> <td>Products </td> <td> :</td> <td><div id="Products">@Html.Partial("ProductsUserControl", Model)</div></td> </tr> </table>Now lets create partial views and for those who does not know how just right-click on the parent folder where your Index view is and Select Add -> View then tick the “create as a partial view”.
Now for the codes:
CategoriesUserControl.cshtml
@model MvcApplication1.Models.ProductCatalog @using (Ajax.BeginForm("SelectCategory", "CascadingDropDown", new AjaxOptions { UpdateTargetId = "SubCategories" })) { @Html.DropDownListFor( m => m.SelectedCategoryId, new SelectList(Model.Categories, "Id", "Name"), string.Empty ) } <script type="text/javascript"> $('#SelectedCategoryId').change(function () { $(this).parents('form').submit(); }); </script>
SubCategoriesUserControl.cshtml
@model MvcApplication1.Models.ProductCatalog @if (Model.SubCategories != null && Model.SubCategories.Count() > 0) { using (Ajax.BeginForm("SelectSubCategory", "CascadingDropDown", new AjaxOptions { UpdateTargetId = "Products" })) { @Html.HiddenFor(m => m.SelectedCategoryId) @Html.DropDownListFor( m => m.SelectedSubCategoryId, new SelectList(Model.SubCategories, "Id", "Name"), string.Empty ) } } <script type="text/javascript"> $('#SelectedSubCategoryId').change(function () { $(this).parents('form').submit(); }); </script>
ProductsUserControl.cshtml
@model MvcApplication1.Models.ProductCatalog @if (Model.Products != null && Model.Products.Count() > 0) { @Html.DropDownList( "Products", new SelectList(Model.Products, "Id", "Name"), string.Empty ) }If you notice instead of Html.BeginForm we use Ajax.BeginForm using the parameters below.
- actionName will be name of your method in your controller
- controllerName will be theame of your controller
- AjaxOptions as the name says AjaxOptions, at this point we only need the UpdateTargetId which we defined as <div> in the index.cshtml file.
Also on your _Layout.cshtml add this on the header if you haven’t done it yet
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>Note : If you are using ASP.Net MVC3 then by default it uses unobtrusive jquery so you need to remove all MicrosoftAjax scripts and use only those two above otherwise the onchange event will open a new page instead of partially rendering it.
Note : If you are using Telerik MVC Controls then you only need the unobtrusive ajax the other script is already referenced by default if you are using Telerik.
Make sure also on your web.config you have the following lines.<add key="ClientValidationEnabled" value="true"/> <add key="UnobtrusiveJavaScriptEnabled" value="true"/>At this point you have done everything you need and your ready to roll.
Subscribe to:
Posts (Atom)

