Thursday, January 12, 2012

Future of Hard-Disk Drives?

All tape drives of the past and most recent high capacity drives used today after all are magnetic drives (which use "ferromagnets" to store bits).

Then Solid State Drives (SSDs) gave a new direction of fastest drives. I think that's the future of hard-drives for another 5 years.

However, what if we had a mixture of two? The real future of storage I think will be storage using atomic structures with an addressing scheme and algorithm of an SSD and a four-atom-wide wires. Instead of flip-flops, "antiferromagnets" will be used and result will be lightening fast drives with thousands of TB of storage... ?

Read about flip-flop replacement:
Tiny hard drive stores one byte of data with just 12 atoms
About connecting-wire replacement:
Four-atom-wide wire may herald tiny computers

I am ready to buy that drive as soon as it becomes available ;)

Saturday, January 07, 2012

Microsoft Visual Studio Useful Shortcuts

Here is a link where Visual Studio shortcuts are available which can make you efficient developer if you make good use of them…

http://msdn.microsoft.com/en-us/library/da5kh0wa.aspx

Thursday, December 15, 2011

IE 6 is ending in January 2012

So Microsoft has planned to give a new year present by forcefully pushing IE6 to the next world. They have decided to upgrade everyone's browser to maintain a minimum version.

Read more here:

IE to Start Automatic Upgrades across Windows XP, Windows Vista, and Windows 7

Tuesday, October 11, 2011

SQL Server Management Studio 2008 (SSMS) - Intellisense is not working

The SSMS intellisense wasn't working for me when we migrated our database server from 2005 to 2008. Here is what I used and its working for me pretty well.

http://www.devart.com/dbforge/sql/sqlcomplete/download.html

Install the Express version of it and it does the job!

Monday, October 10, 2011

Google DART - A Structured way of web programming

How often do you see a new programming language launched? Yes, its very rare.

Google today has launched a new programming language called DART which seems similar to C/C++ and Java.

Following up here:
Google Dart - A javascript alternative

and

http://www.dartlang.org/

Microsoft Security Essentials and Google Chrome

Recently, Microsoft Security Essentials (MSSE) installed on my PC detected a "Password Stealer". I opted to delete the "password stealer". Then I tried to open my Chrome browser and BOOM, it crashed saying the file doesn't exist. I figured out that the "password stealer" deleted by MSSE was in fact Google Chrome.

I reinstalled Chrome, but that won't run saying a permission error. Here is what I did to solve that:

1. Go to: C:\Documents and Settings\\Local Settings\Application Data\Google\Chrome\Application
2. Run chrome_new.exe

That's it, now run Chrome.exe, and you should be able to use Google Chrome again.

Wednesday, June 01, 2011

Quick Code Documentation

Documentation of Code seem the least "productive" task but it is important. I have always been adding comments in the code but until today, I couldn't find a "great" tool that could do more than just copying my comments and display in an auto-generated documentation.

Then, here is what I found, an automated documentation generating tool:
1. Download and install "Doxygen"
http://www.stack.nl/~dimitri/doxygen/index.html

2. Install GraphViz (open source majorly funded by AT&T)
http://www.graphviz.org/

3. While generating the documentaion through "Doxygen", mention "Use dot tool from the GraphViz Package" option if you are on the Wizard > Diagrams tab.

4. Create Folder in which you want to have the documentation generated and specify other preferences.

5. You'll have to select "Run" tab and say "Run Doxygen" to generate to documentation.

Open "Index.html" to start viewing the documentation!

The tool is so good that it allows you to create Class Diagrams, Inheritence Diagram, UML Diagrams and more all by looking at the code.

Have Fun!

Wednesday, April 27, 2011

Cannot add a SimpleContent column to a table containing element columns or nested relations

Recently I ran into a problem while dealing with DataSets. I was adding a colum to an XSD through Visual Studio desinger and it kept failing with following error:

Cannot add a SimpleContent column to a table containing element columns or nested relations.

This is a known issue. However, the solution is not well known :)

To be simple and streight forward, I tell you the solution which I tried and it worked,
1. Note down the column names, datatypes and relationships of the table.
2. Delete the table.
3. Add new table and add columns to it.
4. Redefine relationships.

Best of luck.

Tuesday, March 29, 2011

Search All Tables in SQL Database for a Value

You can use the following query to perform your search. Just replace the "@myValue" with your value.


Declare @TN as varchar(200), @CN as varchar(200), @myValue varchar(30), @SQL as nvarchar(1000)
, @SN as varchar(200), @Exact_Match bit

Create Table #myTable (Table_Name varchar(200), Column_Name varchar(200), Number_Of_Rows int)

-- Replace @myValue with the value you're searching for in the database
Set @myValue = 'Value to Search'
-- 0 for LIKE match, 1 for exact match
Set @Exact_Match = 1

Declare myCursor Cursor For
Select T.Table_Name, C.Column_Name, T.Table_Schema
From INFORMATION_SCHEMA.TABLES T Inner Join INFORMATION_SCHEMA.COLUMNS C
On T.Table_Schema = C.Table_Schema And T.Table_Name = C.Table_Name
Where T.Table_Name <> 'dtproperties' And Table_Type = 'Base Table'
And C.Data_Type In ('varchar','char','nvarchar','nchar','sql_variant')
--And C.Data_Type In ('text','ntext')
--And C.Data_Type In ('tinyint','int','bigint','numeric','decimal','money','float','smallint','real','smallmoney')
--And C.Data_Type In ('datetime','dmalldatetime')
-- Fields not searched: image, uniqueidentifier, bit, varbinary, binary, timestamp
Open myCursor
Fetch Next From myCursor Into @TN, @CN, @SN
While @@Fetch_Status <> -1
Begin
If @Exact_Match = 0
Set @SQL = N'Insert Into #myTable Select ''' + @SN + '.' + @TN + ''', ''' + @CN + ''', Count(*) From [' + @SN + '].[' + @TN + '] Where [' + @CN + '] Like ''%' + @myValue + '%'''
Else
Set @SQL = N'Insert Into #myTable Select ''' + @SN + '.' + @TN + ''', ''' + @CN + ''', Count(*) From [' + @SN + '].[' + @TN + '] Where [' + @CN + '] = ''' + @myValue + ''''
--Print @SQL
Exec sp_executesql @SQL
Fetch Next From myCursor Into @TN, @CN, @SN
End
Close myCursor
Deallocate myCursor
Select * From #myTable Where Number_Of_Rows > 0 Order By Table_Name
Drop Table #myTable

Source: http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_23001597.html

Friday, February 18, 2011

Enabling/ Disabling Developer Dashboard in SharePoint 2010

Developer dashboard is not only for Developers, the administrators can also take good advantage of it. They can do quantitative analysis if their site is slow then how much slow and when the users started raising complaints.

There are three in which this DD can remain:

1. OFF (which is by default)

2. ON - which turns it on all the time. It is generally not a good option as it causes performance overhead and turning it on would make all the Site Collection Admins to see it.

3. On Demand – It appears like a small button and site collection admins can turn it on any time they want. This is most feasible option.

To set it to OnDemand, execute following powershell cmdlets:

$dd = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings

$dd.DisplayLevel = ‘OnDemand’

$dd.TraceEnabled = $true

$dd.Update()

This is enabled on the whole farm so you can go and look the the Right-Top of the site where a white colored button should appear. Upon clicking that, you should be able to see the developer dashboard.

Display Level can be:

$dd.DisplayLevel = ‘OnDemand’

$dd.DisplayLevel = ‘On’

OR

$dd.DisplayLevel = ‘Off’

Monday, February 14, 2011

The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

 

While configuring the SharePoint 2010 for Forms Based Authentication, I encountered above error. To get the problem, I had to change “IncludeExceptionDetailInFaults” to true somewhere. But WHERE?

Here is what solved my problem:

Go to following path:

1. C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\WebServices\SecurityToken

2. Open Web.config there.

3. Add following in the “behaviors > serviceBehaviors > behavior” node.

<serviceDebug includeExceptionDetailInFaults="true"/>

Now try to login and see what error it gives, off to a next error Smile

SharePoint 2010 Error Log Viewer

Perhaps I posted this before, but if not, I am posting again for my reference.

Use this tool to view SharePoint 2010 Error Logs:

http://code.msdn.microsoft.com/ULSViewer/Release/ProjectReleases.aspx?ReleaseId=3308

SharePoint 2010 Log files are usually located here, sort by date and open the latest one in the ULS Viewer:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS

Create a “Filter” and select “Message” and enter “Error” in value. This should give you all error entries in the file and you can find out what is wrong.

Friday, February 11, 2011

Before Uninstalling the Filestream Provider for Remote Blob Storage for SharePoint 2010

Before uninstalling the Filestream provider, make sure that you have content migrated back in the content database. To ensure this, just open “AllDocStreams” in the SharePoint Content database and look at the “Content” and “Rbsid” columns. the “Rbsid” columns should be NULL and “Content” column should be filled with data.

If you uninstall the RBS provider before migrating the data back in the content database, all the data will become unavailable/ inaccessible.


Use following command to Migrate content back and forth from and to DB to Blob Store:

$rbss.SetActiveProviderName(“”)
$rbss.Migrate()


Enabling Remote Blob Storage on Content Database Again

The scenario was, I installed the RBS with Filestream and uninstalled the RBS and realized that all the blobs are still out there on file system due to which the uninstall process failed. Now I tried to call $rbss.Migrate() in PS but it failed because the RBS was no longer installed!

I tried to call $rbss.Enable() but it failed with an error saying “SQL Remote Blob Storage should be installed on the web front end and content database before your can enable it” something like that.

I re-installed RBS and filestream provider but it didn’t let me enable it and kept giving error.

RESOLUTION and Lesson Learnt:

To resolve the error, I re-booted the server and it worked. It is important to note that after installing RBS, it is required to restart the windows if are failing to “Enable” it on the content database.

Wednesday, February 09, 2011

SharePoint Remote Blob Store with FILESTREAM Provider

To provision a Remote Blob Storage with FILESTREAM Provider provided by Microsoft, you have to follow instructions in this article:

http://technet.microsoft.com/en-us/library/ee663474.aspx

Things to NOTE:

1. For me, the tables with prefix mssqlrbs in the content database somehow didn’t appear by running the following command so I had to use wizard to create those tables in the content database instead of following command:

msiexec /qn /lvx* rbs_install_log.txt /i RBS_X64.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME="<ContentDbName>" DBINSTANCE="<DBInstanceName>" FILESTREAMFILEGROUP=RBSFilestreamProvider FILESTREAMSTORENAME=FilestreamProvider_1

Where:


  • <ContentDbName> is the database name.
  • <DBInstanceName> is the SQL Server instance name.

2. To Migrate all the data from Database to newly provisioned Blob Store, just execute following cmdlets in SharePoint Powershell:



$cdb = Get-SPContentDatabase -WebApplication <http://SiteName>
$rbss = $cdb.RemoteBlobStorageSettings
$rbss.SetActiveProviderName($rbss.GetProviderNames()[0])
$rbss.Migrate()


To reverse the process, execute following:



$rbss.SetActiveProviderName(“”)
$rbss.Migrate()


Upon running 1st Migrate Command, notice that in the “AllDocStreams” table in content database, the content is removed from the “Content” column and “Rbsid” is populated with IDs of content on file system. When we set the “active provider” back to none and then run the migrate command, the Rbsid column is emptied and “Content” column is populated with content.


3. FILESTREAM Provider Limitations: It doesn’t allow you to use anything other than local disk space. To use any other network storage, you have to write your own provider. Go to http://sqlrbs.codeplex.com to get a basic version of custom RBS provider.


4. The SQLRemoteBlobs.dll path should be following after the installation of RBS: C:\Windows\assembly\GAC_MSIL\Microsoft.Data.SqlRemoteBlobs\10.50.0.0__89845dcd8080cc91\Microsoft.Data.SqlRemoteBlobs.dll


5. Must read following before customizing it (Specifications):


http://msdn.microsoft.com/en-us/library/cc905212(v=SQL.100).aspx


6. Garbage Collection:


http://www.sqlskills.com/BLOGS/PAUL/post/FILESTREAM-garbage-collection.aspx


http://technet.microsoft.com/en-us/library/ff943566.aspx


C:\Program Files\Microsoft SQL Remote Blob Storage 10.50\Maintainer>Microsoft.Data.SqlRemoteBlobs.Maintainer.exe -ConnectionStringName RBSMaintainerConnection -Operation GarbageCollection -GarbageCollectionPhases r


With above command, the table “rbs_internal_blobs” is cleaned up. But the duplicated resources are not yet deleted from file system.

Tuesday, January 18, 2011

SharePoint 2010: Specified value is not supported for the parameter

Make sure AD is accessible. If you are not connected to domain directly, make sure you have VPN connected.

Hope this helps…

Saturday, January 15, 2011

The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.

Try following:

- Right click powershell and “Run as Administrator”. This worked for me because my user already had dbo rights to SharePoint_Config database.