Wednesday, August 24, 2011

What are the features available in SharePoint 2010 which are not available in MOSS 2007?

1.      New User Interface including Ribbon
2.      Sandboxed Solutions
Also called as User Solutions, is a new concept which allows site collection administrators to deploy solutions at the site collection level which is safe to run and not affect the other site collections and web applications running on the same farm. Farm administrators can monitor sandboxed solutions and place restrictions on the resources, such as memory and CPU cycles, they can use. Sandboxed Solutions does not cover full SharePoint object model but it addresses the key scenarios like custom web parts and event receivers. The solution deployment as in SharePoint 2007 is still exists in SharePoint 2010 but those solutions are called as Farm solutions.
3.      SharePoint Workspace
Microsoft Office Groove has been renamed to SharePoint Workspace in SharePoint 2010. SharePoint Workspace provides local and offline read-write access to SharePoint lists and libraries and also incorporates offline-online synchronizations.
4.      Stsadm command-line tool is superseded by Windows PowerShell 2.0
5.      BCS(Business Connectivity Services) 
Provides Read-Write capable connectivity from Client and Server to Database, WCF/Web Services and .Net Sources.
6.      Client Object Model
The SharePoint 2010 Client Object Model is a very cool feature of SharePoint 2010 Foundation Server that enables developers to write applications that access SharePoint data from a .NET application running on a client computer, from a Silverlight application, and from JavaScript running client-side in a SharePoint web part.  The client object model enables this without requiring the developer to write or install code on the SharePoint server. (Using Microsoft.SharePoint.Client namespace)
7.      Visual Web parts
8.      Redesigned Central Administration web site
9.      Shared Service Provider (SSP) no more exists
SSP's have been replaced by Service Applications in SharePoint 2010. Earlier in SharePoint 2007, all services were combined into a SSP. Now in SharePoint 2010, all services are running as independent Service Application.
10.  Built-in Silverlight Support         
11.  Rich and Improved Theming Support
The new 2010 themes use an entirely different design. SharePoint 2007 themes used CSS and images while the new 2010 themes use the .thmx format. This means themes can be easily created using PowerPoint or any other tools(ex Microsoft Theme Builder)
12.  Multiple Browser Support  - IE, Firefox & Safari
13.  Rich Media support and Digital Asset Management
SharePoint 2010 includes a Media web part built using Silverlight, Video content type, Audio content type, and Image content type. 

Friday, August 5, 2011

SSIS-Script Task - Generics List use

' Microsoft SQL Server Integration Services Script Task
Imports
System
Imports
System.DataImports System.MathImports Microsoft.SqlServer.Dts.RuntimeImports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports
Microsoft.SqlServer.Dts.Runtime.Wrapper
Imports
System.CollectionsImports System.Collections.Generic
Imports
System.TextImports System.Data.SqlClientImports System.NetImports System.Net.MailPublic
Class ScriptMain' The execution engine calls this method when the task executes.' To access the object model, use the Dts object. Connections, variables, events,' and logging features are available as static members of the Dts class.
----------------------------------------------------------------------------------------------------
' Public Sub Main()'' Add your code here


Dim Users As New List(Of User)Dim Managers As New ArrayList()Dim objUser As UserDim objManager As String


Dim smtpConnectionString As String = DirectCast(Dts.Connections("SMTP_CONN_MAIL_SERVER").AcquireConnection(Dts.Transaction), String)Dim smtpServer As String = smtpConnectionString.Split(New Char() {"="c, ";"c})(1)Dim htmlMessageFrom As String = Dts.Variables("emailFrom").Value.ToString()Dim htmlMessageTo As String


Dim htmlMessageSubject As String = Dts.Variables("emailSubject").Value.ToString()Dim htmlMessageBody As New StringBuilder()' get users objectUsers = getUsers()
' create a unique list of manager list contains email address
For Each objUser In UsersIf Not (Managers.Contains(objUser.strManagerEmail.ToString().Trim())) ThenManagers.Add(objUser.strManagerEmail.ToString().Trim())
End IfNext' send Mail
  htmlMessageTo = objManager.ToString()
For Each objManager In Managers'objUser.strManagerEmail.ToString()
  htmlMessageBody.Append(
    For Each objUser In Users      If (objUser.strManagerEmail.ToString() = objManager.ToString()) Then ' get list of users for a manager
          htmlMessageBody.Append(
"text" & objUser.strPSTSize.ToString("###,###,###,##0") & ")      End If  Next
htmlMessageBody.Append(

SendMailMessage(htmlMessageTo, htmlMessageFrom, htmlMessageSubject, htmlMessageBody.ToString(),
"some text")True, smtpServer)' reset the bodyhtmlMessageBody.Remove(0, htmlMessageBody.Length)
htmlMessageTo =
String.EmptyNextDts.TaskResult = Dts.Results.Success
End Sub
----------------------------------------------------------------------------------------------------




Public Function getUsers() As List(Of User)Dim objUsers As List(Of User) = New List(Of User)()Dim newUser As UserDim cm1 As ConnectionManager = Dts.Connections("ISTools_ADO.NET")'Dim cm2 As ConnectionManager = Dts.Connections("ISTOOLS_OLEDB")
Dim oReader As SqlDataReader' For an ADO.Net ConnectionManager using a SqlClient provider

oCmd.CommandType = Data.CommandType.Text
oCmd.CommandText =
Dim sqlConn As System.Data.SqlClient.SqlConnection = DirectCast(cm1.AcquireConnection(Dts.Transaction), SqlConnection)Dim oCmd As SqlCommand = New SqlCommand"select * FROM table"oCmd.Connection = sqlConn
'sqlConn.Open()oReader = oCmd.ExecuteReader()
If oReader.HasRows Then
objUsers.Add(
Convert.ToInt32(oReader(3)), Convert.ToInt32(oReader(4)), Convert.ToString(oReader(6)), Convert.ToString(oReader(7))))
While oReader.ReadNew User(Convert.ToString(oReader(0)), Convert.ToString(oReader(1)), Convert.ToInt32(oReader(2)), _End WhileEnd If'release the object finally
cm1.ReleaseConnection(sqlConn)


----------------------------------------------------------------------------------------------------Private Sub SendMailMessage( _ByVal SendTo As String, ByVal From As String, _ByVal Subject As String, ByVal Body As String, _ByVal IsBodyHtml As Boolean, ByVal Server As String)If (SendTo.Trim() = "") Then SendTo = FromDim htmlMessage As MailMessageDim mySmtpClient As SmtpClientDim maSendTo As New MailAddress(SendTo)Dim maFrom As New MailAddress(From)New MailMessage(maFrom, maSendTo)New SmtpClient(Server)End Sub








htmlMessage =
htmlMessage.Subject = Subject
htmlMessage.Body = Body
htmlMessage.IsBodyHtml = IsBodyHtml
mySmtpClient =
mySmtpClient.Credentials = CredentialCache.DefaultNetworkCredentials
mySmtpClient.Send(htmlMessage)
htmlMessage.Dispose()
----------------------------------------------------------------------------------------------------



Private Function uniqueArray(ByVal str() As String) As ArrayListDim noDups As New ArrayList()For i As Integer = 0 To str.Length - 1If Not noDups.Contains(str(i).Trim()) ThennoDups.Add(str(i).Trim())
End IfNext
---------------------------------------------------------------------------------------------------- Class
End
----------------------------------------------------------------------------------------------------Public
Class User' User Object to hold each user record. Create pr0perties to read/write'Dim strLanid As String'Dim strFullName As String'Dim strHDriveSize As Integer'Dim strPSTSize As Integer'Dim strNonPSTSize As Integer
'Dim strUserEmail As String
----------------------------------------------------------------------------------------------------









----------------------------------------------------------------------------------------------------Private p_strLanid As StringPrivate p_strFullName As StringPrivate p_strHDriveSize As IntegerPrivate p_strPSTSize As IntegerPrivate p_strNonPSTSize As IntegerPrivate p_strUserEmail As String
-properties
Public Property strLanid() As StringGet
Return p_strLanidEnd Get
p_strLanid = value
Set(ByVal value As String)End SetEnd PropertyPublic Property strFullName() As StringGet
Return p_strFullNameEnd Get
p_strFullName = value
Set(ByVal value As String)End SetEnd PropertyPublic Property strHDriveSize() As IntegerGet
Return p_strHDriveSizeEnd Get
p_strHDriveSize = value
Set(ByVal value As Integer)End SetEnd PropertyPublic Property strPSTSize() As IntegerGet
Return p_strPSTSizeEnd Get
p_strPSTSize = value
Set(ByVal value As Integer)End SetEnd PropertyPublic Property strNonPSTSize() As IntegerGet
Return p_strNonPSTSizeEnd Get
p_strNonPSTSize = value
Set(ByVal value As Integer)End SetEnd PropertyPublic Property strUserEmail() As StringGet
Return p_strUserEmailEnd Get
p_strUserEmail = value
Set(ByVal value As String)End SetEnd PropertyPublic Property strManagerEmail() As StringGet
Return p_strManagerEmailEnd Get
p_strManagerEmail = value
Set(ByVal value As String)End Set
----------------------------------------------------------------------------------------------------
Public Overrides Function ToString() As String






----------------------------------------------------------------------------------------------------
End
----------------------------------------------------------------------------------------------------
Class
----------------------------------------------------------------------------------------------------
InnerList.Add(GenericObject)
----------------------------------------------------------------------------------------------------
InnerList.RemoveAt(index)
Public Sub Remove(ByVal index As Integer)End Sub

----------------------------------------------------------------------------------------------------End
Class 'End of GenericCollection class
Public Function Item(ByVal index As Integer) As GenericTypeReturn CType(InnerList.Item(index), GenericType)End Function
Public Sub Add(ByVal GenericObject As GenericType)End Sub
GenericCollection(Of GenericType)Inherits Collections.CollectionBase
Class 'End of Employee Class
Return ("LanId : " + strLanid + vbCrLf + _"FullName : " + strFullName + vbCrLf + _"HDriveSize : " + strHDriveSize.ToString() + vbCrLf + _"PSTSize : " + strPSTSize.ToString() + vbCrLf + _"NonPSTSize : " + strNonPSTSize.ToString() + vbCrLf + _"UserEmail : " + strUserEmail + vbCrLf + _"ManagerEmail : " + strManagerEmail)End Function
End Property
Private p_strManagerEmail As String
Sub New(ByVal Lanid As String, ByVal FullName As String, ByVal HDriveSize As Integer, ByVal PSTSize As Integer, _ByVal NonPSTSize As Integer, ByVal UserEmail As String, ByVal ManagerEmail As String)Me.strLanid = LanidMe.strFullName = FullNameMe.strHDriveSize = HDriveSizeMe.strPSTSize = PSTSizeMe.strNonPSTSize = NonPSTSizeMe.strUserEmail = UserEmailMe.strManagerEmail = ManagerEmailEnd Sub
'Dim strManagerEmail As String
Return noDupsEnd Function
Return objUsersEnd Function
Text")
' Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
' Write scripts using Microsoft Visual Basic
' The ScriptMain class is the entry point of the Script Task.
' Developed by Rajesh Subbiah on 5 Aug 2011