Tuesday, September 17, 2013

Step by Step procedure to install sharepoint 2010 /
Step by Step procedure to install sharepoint 2013 /

Steps:
====

Step by step process to install sahrepoint 2007 on windows server 2008 r2 :

Steps:
========

Please visit link for best procedure to do it :
http://sharepoint-tutorial.net/post/2008/08/14/installing-moss-2007-on-windows-server-2008-and-sql-server-2008-part-1-overview.aspx
Step by Step process to Install Sharepoint 2010 on windows 7 .

Steps:
Frist check for the version of windows 7 you have .
Most of them will be stuck at the end after the whole installation process trying to figure out why the iis isnt working and other issue i cannot find iis managment console option in windows turn on and off features.

Please check the table for option provided in windows 7 editions:
Feature Name/DescriptionWindows Server 2008 R2 EditionsWindows 7 Ultimate, Professional, and Enterprise EditionsWindows 7 Home Premium EditionWindows 7 Home Basic and Starter Editions
IIS Management Console
IIS Manager provides infrastructure to manage IIS 7.5 by using a graphical user interface. You can use IIS Manager to manage a local or remote Web server that runs IIS 7.5.
Default *
Default
Default
Unavailable
IIS Management Scripts and Tools
IIS Management Scripts and Tools provide infrastructure to manage an IIS 7.5 Web server programmatically by using commands in a Command Prompt window or by running scripts. You can use these tools when you want to automate commands in batch files or when you do not want to incur the overhead of managing IIS by using the graphical user interface.
Available
Available
Available
Available
Management Service
Management Service provides infrastructure to configure the IIS 7.5 user interface, IIS Manager, for remote management in IIS 7.5.
Available
Available
Available
Unavailable
IIS 6.0 Management Compatibility
IIS 6.0 Management Compatibility provides forward compatibility for your applications and scripts that use Admin Base Object (ABO) and Active Directory Service Interface (ADSI) APIs. This lets you use existing IIS 6.0 scripts to manage an IIS 7.5 Web server.
Available
Available
Available
Available
IIS Metabase Compatibility
IIS 6.0 Metabase Compatibility provides infrastructure to query and configure the metabase so that you can run applications and scripts written in earlier versions of IIS that used the Admin Base Object (ABO) or Active Directory Service Interface (ADSI) APIs.
Available
Available
Available
Available
IIS 6 WMI Compatibility
IIS 6.0 WMI Compatibility provides Windows Management Instrumentation (WMI) scripting interfaces to programmatically manage and automate tasks for IIS 7.5 by using a set of scripts that you create in the WMI provider. You can manage sites with this service by using the WMI CIM Studio, WMI Event Registration, WMI Event Viewer, and WMI Object Browser tools.
Available
Available
Available
Unavailable
IIS 6 Scripting Tools
IIS 6.0 Scripting Tools provides the ability to continue using IIS 6.0 scripting tools that were built to manage IIS 6.0 in IIS 7.5. This is especially useful if your applications and scripts use ActiveX Data Objects (ADO) or Active Directory Service Interface (ADSI) APIs. IIS 6.0 Scripting Tools requires the WAS Configuration API.
Available
Available
Available
Unavailable
IIS 6 Management Console
IIS 6.0 Manager provides infrastructure for administration of remote IIS 6.0 servers from this computer.
Available *
Available
Available
Unavailable



For even more details :please visist :http://technet.microsoft.com/en-us/library/cc753473.aspx
@microsoft

next follow the document for installation process :http://msdn.microsoft.com/en-us/library/ee554869(v=office.14).aspx
@microsoft


Thursday, September 12, 2013

Problem >> Object moved here  in asp.net ? c#?
Solution >> add a try catch block to the response .redirect
try
                    {
                        HttpContext.Current.Response.Redirect(url1,true);
                    }
catch (exception ex)
{
repsonse.write(ex);
}

Thursday, September 5, 2013

Probelm>> How To Add Hyperlink to gridview elements.
Solution >>
<asp:TemplateField HeaderText="  test" Visible="True" SortExpression="test">
                    <ItemTemplate>
                        <asp:HyperLink ID="test" runat="server"  Text='<%# Bind("test") %>'></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>

The bind value must match the data retrivewd from the sql query.
Problem >> Round value to two decimal value in sql .
Solution >>
select round(100/50.0,2),cast(round(100/50.0,2) as numeric(36,2))
Returns
20.000000   20.00
Problem >> SQL : Error converting data type varchar to numeric .
Solution>> Check for any string concatenations in your returning value of sql query .
ex: ((total-used)/total)*100 +'%' As percentage this try to convert varchar to int and thats the problem ,
If this dosent work try casting
SELECT CAST(Mydate AS datetime) AS [Login Date/Time], Uname AS [User Name] .....etc.

Tuesday, September 3, 2013

Problem>> How to write Dynamic sql Query?
Solution>> Go to this link http://www.sqlusa.com/bestpractices/dynamicsql/
The best place to learn About dynmaic sql
 or see below

USE AdventureWorks2008;
EXEC ('SELECT * FROM Production.Product')    -- tsql constant string execution ------------
DECLARE @TableName sysname ='Sales.SalesOrderHeader'
EXECUTE ('SELECT * FROM '+@TableName)        -- T-SQL string with variable - dynamic ------------
EXECUTE sp_executeSQL N'SELECT * FROM Purchasing.PurchaseOrderHeader'
------------

DECLARE @SQL varchar(256); SET @SQL='SELECT * FROM Production.Product'
EXEC (@SQL)                -- SQL Server 2008 dynamic SQL query execution
------------

DECLARE @SQL varchar(256), @Table sysname;
SET @SQL='SELECT * FROM'; SET @Table = 'Production.Product'
SET @SQL = @SQL+' '+@Table
PRINT @SQL     -- for debugging dynamic SQL prior to execution of generated static code
EXEC (@SQL)    -- Microsoft dynamic SQL execution - SQL Server 2005 execute dynamic SQL
-------------- Dynamic queries with local variables and parameter(s) - t-sql parameterized query
-- Parameters are NOT ALLOWED everywhere in an SQL statement - hence dynamic SQL
DECLARE @Color varchar(16) = 'Yellow'
SELECT Color=@Color, ProductCount=COUNT(Color)
FROM AdventureWorks2008.Production.Product
WHERE Color = @Color
/*    Color    ProductCount
      Yellow      36              */------------
-- SQL Server 2012 sp_executeSQL usage with input and output parameters (2008/2005)
DECLARE @SQL NVARCHAR(max), @ParmDefinition NVARCHAR(1024)
DECLARE @ListPrice money = 2000.0, @LastProduct varchar(64)
SET @SQL =       N'SELECT @pLastProduct = max(Name)
                   FROM AdventureWorks2008.Production.Product
                   WHERE ListPrice >= @pListPrice'
SET @ParmDefinition = N'@pListPrice money,
                        @pLastProduct varchar(64) OUTPUT'
EXECUTE sp_executeSQL      -- Dynamic T-SQL
            @SQL,
            @ParmDefinition,
            @pListPrice = @ListPrice,
            @pLastProduct=@LastProduct OUTPUT
SELECT [ListPrice >=]=@ListPrice, LastProduct=@LastProduct
/* ListPrice >=   LastProduct
2000.00     Touring-1000 Yellow, 60 */
------------
-- 3-part naming execution of dynamic SQL - Specifying database (USE dbname)
EXEC AdventureWorks2008R2.dbo.sp_executeSQL N'exec sp_help'
------------
For more details about other operations please visit the below link
Problem>> Dynamic sql query in stored procedure error could not figure out ?
or
Dynamic sql query in stored procedure MAX length error ?
or
How to break dynamic sql query into parts?

Solution>> SET @sqlPART1='First half of your dynamic query which is less than 4000 characters '
SET @sqlPART2='Second half of your dynamic query which is less than 4000 characters '

EXEC(@sqlPART1+@sqlPART2)



Problem>> How to clear the dropdown value to default in ASP.Net C#?
or
How to reset the dropdown to first value  in ASP.Net C#?

Solution>>  you can use any one of these
Approach 1 ) dropdownlist1.selectedindex=0;
Approach 2  )dropdownlist1.selectedindex = -1
Approach 3 ) DropDownList1.Items.Clear();

Tuesday, August 27, 2013

Problem>> Adding Confirmation to delete operation in Gridview .
Solution >>

 protected void Gridview1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
 if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //CommandField, i.e. I placed it as the first column
                foreach (Control control in e.Row.Cells[0].Controls)
                {
                      //change the button type depending on webcontrol.(button type)
                    //Swap string with:
                    //System.Web.UI.WebControls.DataControlLinkButton for LinkButton
                    //System.Web.UI.WebControls.DataControlImageButton for ImageButton
                    if (control.ToString() == "System.Web.UI.WebControls.DataControlLinkButton")
                    {
                        LinkButton currentButton = (LinkButton)control;

                        if (currentButton.Text == "Delete")
                        {
                            currentButton.OnClientClick =
                                "if (!window.confirm('Are you sure?')) return false;";
                        }
                    }
                }
}
PROBLEM>> DYNAMIC SQL QUERY FOR STORED PROCEDURES ?
SOLUTION>> The curse and blessings of dynamic SQL.

Friday, August 23, 2013

Problem>> On seclected index change event fires for evry post back/ refresh?
Solution>> Check for enable='true' property in your dropdown .

Problem>>  Drop down refresh to first value ?
Solution>>   Dropdownlist1.SelectedValue = Gridview.DataKeys[e.Row.RowIndex].Value.ToString();

Wednesday, August 21, 2013

Problem>> How to used ajax in asp.net?
Solution>>   in your toolbox check for AJAX Extensions.
Now drag and drop a script manager onto you webpage in design mode .
now drag and drop update panel  onto you webpage in design mode .
Add elements that you  want to have features of ajax int the update panel.
make sure that your code is in between update panel tags if you want the ajax feature .
                    

PROBLEM>> Why Multiple gridviews displaying when ajax is used.
Solution>>  check for the <div> tags in the code remove the div tags within  the update panel .That should fix your issue.
If it dint fix it post your problem here int he blog.
  

Friday, August 16, 2013

Problem >> How to add multiple headers in GRID VIEW ,ASP.Net?
Solution >> To add just add this part of code to your gridview

in your grid view add this code . 

 <asp:TemplateField>
                    <HeaderTemplate>
                        <tr style="width: 100%" Class="TEST">
                            <th >Hardware</th>
                            <th >Software</th>
                        </tr>
                    </HeaderTemplate>
   </asp:TemplateField>
Problem>> The type or namespace 'Linq ' dose not exists in the namespace 'System' ('are you missing an assembly reference ?)
Solution >> goto web config and all system .core to it .System.linq exists in System.core assembly so add it to config file.
This is how it looks like
 <compilation debug="false" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
 <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
    </compilation>
Problem >>The Name "XXXXX" dose-not exist in the context.
Solution >> please check weather the the file opened is a website or project ?
you check that  in the file you will find .csproj file if its a project file if not its a website.
To open a project  file just click on the solution file and it will take 5 sec and more as per your system speed.