- {0} – The URL to your site. This could be the root web or a child site.
- {1} – The GUID for your list.
- {2}- The GUID of the view - optional
Thursday, January 26, 2012
Getting XML Data From a SharePoint List
Thursday, December 29, 2011
To Access SharePoint fields in JQuery
To Access SharePoint fields in JQuery
By default we can access by
$("input[title='title name']")
or
$("input[VALUE='OK']") // for OK button
If we modify to Sharepoint List form field
See the source of the form and find out the ID in SPD.
Example $("#[id*='ff2_1']") // 2nd field.
By default we can access by
$("input[title='title name']")
or
$("input[VALUE='OK']") // for OK button
If we modify to Sharepoint List form field
See the source of the form and find out the ID in SPD.
Example $("#[id*='ff2_1']") // 2nd field.
Tuesday, December 27, 2011
SharePoint Infopath Forms Library missing
I have created a new 2010 portal with publishing features template. And tried to create a forms library, ohh gosh!! where is the Form Library under 'Create'. Searched the settings in 'Central Administration', everything seems to be right there.
Got an idea... go to InfoPath Designer and publish a new form template from there to this portal.
Every thing went on smooth except the it has created a simple document library instead forms library.Very Bad.
Ohhh may be i might have missed some thing let me check the site settings
After lot of search & struggling around... found out that
Got an idea... go to InfoPath Designer and publish a new form template from there to this portal.
Every thing went on smooth except the it has created a simple document library instead forms library.Very Bad.
Ohhh may be i might have missed some thing let me check the site settings
- Site Collection Features –> Office SharePoint Server Enterprise Site Collection features
- Site Features –> Office SharePoint Server Enterprise Site features
No luck dude, still no forms library.
After lot of search & struggling around... found out that
- Site Features –> Team Collaboration Lists
Friday, December 9, 2011
Dime, cent, Pennie and Nickel
In US coins
a dime = 10 cents (10 ¢)
a quarter = 25 cents (25 ¢)
a pennie = 1 cent (1¢)
a nickel = 5 cents (5¢)
a quarter = 25 cents (25 ¢)
a pennie = 1 cent (1¢)
a nickel = 5 cents (5¢)
Monday, November 21, 2011
SQL Server Transaction Isolation Level - READ UNCOMMITTED
BEGIN TRAN UPDATE tableA SET HourlyRate = 100 WHERE ConsultantName = 'Raj'Note that the transaction is not committed or rolled back. Since the transaction is open, the lock applied on the row being updated is not released yet. Now, open a second window (Query Window 2) and run the following.
SELECT * FROM tableA
As expected, this will block. The query will try to read a row locked exclusively by another transaction and cannot proceed until the lock is released. Now, let us see what happens under READ UNCOMMITTED isolation level.
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED SELECT * FROM tableA
OR
SELECT * FROM table A WITH(READUNCOMMITTED) 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
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.
Imports
SystemImports
System.DataImports System.MathImports Microsoft.SqlServer.Dts.RuntimeImports Microsoft.SqlServer.Dts.Pipeline.WrapperImports
Microsoft.SqlServer.Dts.Runtime.WrapperImports
System.CollectionsImports System.Collections.GenericImports
System.TextImports System.Data.SqlClientImports System.NetImports System.Net.MailPublicClass 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()
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
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
" Text")
' Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.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 NexthtmlMessageBody.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
Return noDupsEnd FunctionReturn objUsersEnd FunctionClass 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
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 Getp_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
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-properties
Public Property strLanid() As StringGetReturn 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 Getp_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----------------------------------------------------------------------------------------------------
Class 'End of Employee ClassReturn ("LanId : " + strLanid + vbCrLf + _"FullName : " + strFullName + vbCrLf + _"HDriveSize : " + strHDriveSize.ToString() + vbCrLf + _"PSTSize : " + strPSTSize.ToString() + vbCrLf + _"NonPSTSize : " + strNonPSTSize.ToString() + vbCrLf + _"UserEmail : " + strUserEmail + vbCrLf + _"ManagerEmail : " + strManagerEmail)End FunctionEnd PropertyPrivate p_strManagerEmail As StringEnd
----------------------------------------------------------------------------------------------------
Class----------------------------------------------------------------------------------------------------
InnerList.Add(GenericObject)
Public Sub Remove(ByVal index As Integer)End Sub
Public Sub Add(ByVal GenericObject As GenericType)End Sub GenericCollection(Of GenericType)Inherits Collections.CollectionBaseInnerList.Add(GenericObject)
----------------------------------------------------------------------------------------------------
InnerList.RemoveAt(index)Public Sub Remove(ByVal index As Integer)End Sub
----------------------------------------------------------------------------------------------------End
Class 'End of GenericCollection classPublic Function Item(ByVal index As Integer) As GenericTypeReturn CType(InnerList.Item(index), GenericType)End Function" Text")
' 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
Subscribe to:
Posts (Atom)