Sunday, 20 April 2014

Error occurred in deployment step 'Add Solution': Operation is not valid due to the current state of the object

     When i am deploying the solution using Visual studio , it builds fine but while Adding solution gives error :
"Error occurred in deployment step 'Add Solution': Operation is not valid due to the current state of the object".

This is a generic error, I resolve this issue by Reset the IIS. (IISRESET)

Here is the Reference.
 
SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Wednesday, 9 April 2014

Click node text to expand/collapse instead of +/- icon in asp.net treeview

 On a treeview, we can collapse and expand the nodes by clicking the +/- icon. I want to be able to click
the node text to achieve the same results.

We can achieved by using node Id's dynamically and setting the selection node Expand statically.

For Dynamic Treeview, we can implement select action by using node id's.

Example:

   TreeNode.SelectAction = TreeNodeSelectAction.Expand;
 
   Listnode.SelectAction = TreeNodeSelectAction.Expand;


 For static Treeview, We can easily achieved by setting the "selectaction="Expand"" to the Treenode

Example:

<asp:TreeView ID="TVID" runat="server">

  <Nodes>

    <asp:TreeNode Text="Content" SelectAction="Expand">

        <asp:TreeNode Text="Main" SelectAction="Expand">
        
          <asp:TreeNode Text="SharePoint" SelectAction="Expand">
              <asp:TreeNode Text="SharePoint2013"/>
              <asp:TreeNode Text="SharePoint2010"/>
              <asp:TreeNode Text="SharePoint2007"/>
           </asp:TreeNode>

          <asp:TreeNode Text=".Net" SelectAction="Expand">
              <asp:TreeNode Text="4.0"/>
              <asp:TreeNode Text="3.5"/>
              <asp:TreeNode Text="3.0"/>
           </asp:TreeNode>

        </asp:TreeNode>

   </asp:TreeNode>

  </Nodes>

</asp:TreeNode>


By using JavaScript

http://geekswithblogs.net/rajiv/archive/2006/03/16/72575.aspx


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

we cannot locate a server to load the workbook data model


The Issue is occurring because the server instance has not been configured in the Central Administration

First Configure the Excel Services service application on the SharePoint server.

Navigate to Application Management click on Manage service applications.

Click on Excel Services service application that you want to configure.

Click on Data Model Settings

Click on Add Server

In that Server Name box,give the name of the analysis services instance that you want to add


Click OK.

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Tuesday, 8 April 2014

Sorry Something Went Wrong

Many times we are getting this error message like Sorry Something Went Wrong with Correlation ID as shown below.

Replace your Correlation  ID and run the script in SharePoint PowerShell,In C drvice with specified file name we get the message related to the Correlation.

Easily we can find the solution.for executing the script it will take few miniutes time.

get-splogevent | where-object {$_.Correlation -eq "9a34859c-60bf-a0da-b50a-fa2880d55674"} | fl message > C:/SPLog.log 

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Thursday, 27 March 2014

how to connect sqlserver using powershell

Here we can find the script the way we can connect sqlserver DB using PowerShell.

$con = New-Object System.Data.SqlClient.SqlConnection
$con.ConnectionString = "Server=servername;Database=databasename;User ID=username;Password=password;"
$con.Open()
$sql = "your select query"
$cmd = New-Object System.Data.SqlClient.SqlCommand($sql,$con)
$rdr = $cmd.ExecuteReader()
$test = @()
while($rdr.Read())
{
    $test += ($rdr["fieldname"].ToString())
}
#here we can see the output using

Write-Output $test

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Wednesday, 26 March 2014

how to send email with attachment in powershell

$Body = "get the information here to show the data with attachement"  | Set-Content C:\somename.html

$file = "C:\somename.html"
$EmailFrom = "FromMail@Domain.com"
$EmailTo = "ToMail@Domain.com"
$SMTPServer = "Your Smtp Server Name"
$EmailSubject = "Enter Your Subject"
$att = new-object Net.Mail.Attachment($file)

#Send mail with attachment
$mailmessage = New-Object system.net.mail.mailmessage
$mailmessage.from = ($EmailFrom)
$mailmessage.To.add($EmailTo)
$mailmessage.Subject = $EmailSubject
$mailmessage.Body = $Body
$mailmessage.IsBodyHTML = $true
$mailmessage.Attachments.Add($att)
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer)
$SMTPClient.Send($mailmessage)
$att.Dispose()
SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to send email using powershell in sharepoint

Here we can see the script,the way we can sent mail alerts using power shell

$EmailFrom = "FromEmail@domain.com"
$EmailTo = "ToEmail@domain.com"
$SMTPServer = "YourSmtpServerName"
$EmailSubject = "Enter your Subject you want"

$mailmessage = New-Object system.net.mail.mailmessage
$mailmessage.from = ($EmailFrom)
$mailmessage.To.add($EmailTo)
$mailmessage.Subject = $EmailSubject
$mailmessage.Body = "Email body"
#if we are sending any html body we have to use below line
$mailmessage.IsBodyHTML = $true
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer)
#if you want any network credentials set user name and password.
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential("username", "password");
$SMTPClient.Send($mailmessage)

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM