Thursday, March 14, 2013

DataRow.Delete Is Not Equal To DataRows.Remove() OR DataRows.RemoveAt()

DataRow.Delete() VS DataRows.Remove() or RemoveAt()

==============================================================
Important Namespaces: 
- System.Data.Sql
-System.Data.SqlClient
==============================================================
Facing an issue inside one of my projects, i was trying to iterate through the datatable datarows and while i was iterating i was removing datarows using a loop index which was going from 0 upto row count of datatable. But i was constantly facing an error. 

"collection was modified. Enumeration operation might not execute."

There i got the difference. I was using DataRows.Remove() or DataRows.Removeat(). Both function remove the datarow physically and committedly from the datatable which was being used in that loop meanwhile. Now important thing is that you cannot mantain the same count of the rows if you are inside the loop and you are using DataTable.rows.count for iteration condition. 

BUT 

Instead you should use the DataRow.Delete() function. Delete() function will not physically delete the row from datatable. It will mark the row to be deleted or update the rowstate as RowState.deleted. The change will not be committed until you call Datatable.acceptchanges() function. 

Now whatever you do with your datatable it will not commit your changes until you call Acceptchanges() function. 



Thursday, February 21, 2013

Windows shortcut commands

Hello everyone, Today I will share windows shortcut commands on a single place, this will hopefully help everyone in our daily activities

appwiz.cpl    It will open control panel

msconfig    open system configuration

ncpa.cpl     open network settings

eventvwr     open event viewer

inetmgr        open IIS

iisreset           reset IIS

services.msc for opening services console

profiler90    opening sql profile

installutil -i path  for installing (eds) service with visual studio command prompt

regedit    for opening registry editor

dxdiag    opening system diagnostic

msinfo32   open System information

taskmgr opening task manager

mspaint for opening paint

mstsc   Remote Desktop

mmc    open micrososft management console

devmgmt.msc  open device manager  

perfmon   open perfomance monitor

gpedit.msc  Grop policy

compmgmt.msc  open computer management  

%windir%\system32\MdSched.exe   windows memory diagnostics 

%windir%\system32\odbcad32.exe    data sources (ODBC)

printmanagement.msc             open printer management

wmimgmt.msc  open Windows Management Infrastructure (WMI)  

lusrmgr.msc open Local Users and Groups  

certmgr.msc  open certificates  manager

Deleting Services from service Console

Create a new process to the call the "sc.exe" with the parameters as below:

sc.exe delete [service name] 


Thank You....

Friday, February 15, 2013

Deploying File Along With Feature

Few days back, I was working to create an Editor Web Part. The Editor Part contains a drop down and I need to populate it with an XML file (Links.xml) . I had given the file name in XmlDatasource, considering it would be picked, but Editor part gave me an error i.e. file not found.

After doing some research, I came to know a new deployment type ElementFile. This deployment type physically deploy the file along with the feature and we can get the path of the feature then.




SharePoint provides a method for this purpose i.e.. SPUtility.GetGenericSetupPath. By using this method I found my XML file and me editor part started working. I hope this will help any other newbie  in SharePoint..... :)fF

14 HIVE AND OTHER SHAREPOINT 2010 DIRECTORIES


In this post I will list out some important folders used with SharePoint 2010 server. Lets Start with  installation, Configuration and its files, later in the post we will discuss about other 14 hive directories.

C:\Inetpub\wwwroot\wss -
 This directory (or the corresponding directory under the Inetpub root on the server) is used as the default location for IIS Web sites.
C:\ProgramFiles\Microsoft Office Servers\14.0 - This directory is the installation location for SharePoint Server 2010 binaries and data. The directory can be changed during installation.
C:\ProgramFiles\Microsoft Office Servers\14.0\WebServices - This directory is the root directory where SharePoint back-end Web services are hosted, for example, Excel and Search.
C:\ProgramFiles\Microsoft Office Servers\14.0\Data - This directory is the root location where local data is stored, including search indexes.
C:\ProgramFiles\Microsoft Office Servers\14.0\Logs – This directory is the location where the run-time diagnostic logging is generated.

14 hive folders : 


Program Files\Common files\Microsoft Shared\Web Server Extensions\14 -

This directory is the installation directory for core SharePoint Server files.

Program Files\Common files\Microsoft Shared\Web Server Extensions\14\ADMISAPI -

This directory contains the soap services for Central Administration. If this directory is altered, remote site creation and other methods exposed in the service will not function correctly.


Program Files\Common files\Microsoft Shared\Web Server Extensions\14\CONFIG -
This directory contains files used to extend IIS Web sites with SharePoint Server. If this directory or its contents are altered, Web application provisioning will not function correctly.

Program Files\Common files\Microsoft Shared\Web Server Extensions\14\LOGS -

This directory contains setup and run-time tracing logs.
Program Files\Common files\Microsoft Shared\Web Server Extensions\Policy -
Program Files\Common files\Microsoft Shared\Web Server Extensions\UserCode -
This directory contains files used to support your sandboxed solutions.
Program Files\Common files\Microsoft Shared\Web Server Extensions\WebClients -
This directory contains files related to the new Client Object Model.
Program Files\Common files\Microsoft Shared\Web Server Extensions\WebServices -
This directory contains new wcf or .svc related files.
I hope this post will be helpful for you in understanding SharePoint 14  Hive folder hierarchy. Thank You,.

Earn Money ! Affiliate Program
Open Directory Project at dmoz.org