Sunday, June 8, 2014

exporting data and schema to sql server Azure

I have spent lot of time figuring out how to do this .Faced lot of errors like this.

filegroup reference and partitioning scheme is not supported in this version of sql server


Finally able to do it with the help of this blog
http://www.itwriting.com/blog/5993-moving-a-database-from-on-premise-to-sql-azure-some-hassle.html


Just use this option while generating scripts and run it against that database.You are done.It took me lot of hours actually days to figure this out.

image

Tuesday, February 25, 2014

Error after solrnet manual mapping when I try to instantiate ISolrOperations

If you are experiencing one of these errors while using manual mapping and solr .net

Error after solrnet manual mapping when I try to instantiate ISolrOperations

Activation error occured while trying to get instance of type ISolrOperations`1, key ""
Inner exception:
The given key was not present in the dictionary,

Here is the solution change the mapping code to below



            var mapper = new AllPropertiesMappingManager();
            mapper.SetUniqueKey(typeof(SolrConversation).GetProperty("id"));

            var container = Startup.Container;
            container.RemoveAll<IReadOnlyMappingManager>();
            container.Register<IReadOnlyMappingManager>(c => mapper);


            Startup.Init<SolrConversation>(UrlBuilder.EnsureTrailingSlash(_solrBaseUri) + collectionName);
        

Thursday, February 20, 2014

Resharper important shortcuts C#

One of the best shortcuts that I use daily

Ctrl+K,Ctrl+F  : This will auto format the code


Wednesday, February 19, 2014

Convert from Quartz.net scheduler trigger time to timestamp

DECLARE @Ticks BIGINT
 SELECT @Ticks = 635284080000000000


 SELECT Converted = CAST(@Ticks/864000000000.0 - 693595.0 AS DATETIME)

Wednesday, February 5, 2014

Unknown commit parameter 'waitFlush' while using solr.net

waitFlush param is removed from latest solr 4.0.

The nuget package as of today is way too old you can get new package from build machine .

I have got from successful build below as of today and it worked after that

http://teamcity.codebetter.com/repository/download/bt290/87550:id/SolrNet-0.4.0.2002.zip

You can also get latest  from this

http://teamcity.codebetter.com/viewType.html?buildTypeId=bt290



Adding a new core solr

It is so simple to add a new core.

If you already have collections core in this folder
D:\temp\downloads\solr-4.6.1\solr-4.6.1\example\solr

folder
D:\temp\downloads\solr-4.6.1\solr-4.6.1\example\solr\collection1

Let us create a new core with name test

Step1.
Create a folder test
D:\temp\downloads\solr-4.6.1\solr-4.6.1\example\solr\test

Step2.
Copy the conf directory from existing core in this example from collection

So your test will have only this conf directory

Step3.
Run this url in browser to create

http://localhost:8983/solr/admin/cores?action=CREATE&name=test&instanceDir=test&config=solrconfig.xml&schema=schema.xml&dataDir=data
You can change the parameters above in url if you want.Else it works..
Simple..