Connection Strings for Desktop Search in Application

Okay, I have been fighting with this for about two days now.  I believe I mentioned previously that there isn’t much docuemntation on the new desktop seach for Windows Server 2008.  it turns out that what I thought to be true was in fact wrong.  I thought, and please correct me if I am wrong, that the windows search feature in Windows Server 2008 is the same as the windows search feature in Vista.  Boy I was wrong on that one.  I was trying to search for something that wasn’t there.  I just needed a different connection string is all. Here is what I used for Vista:

 

Dim connString As String = “Provider=MSIDXS.1;Integrated Security .=””

 

It works fine.  I thought it worked fine in server 2008 also.  I was trying to find a whole plethora of solutions that could fix my problem.  What I needed to change was that line of code above to:

 

Dim connString As String = “Provider=Search.CollatorDSO;Extended Properties=’Application=Windows’”

 

Go figure! The error I was getting was System.Data.OleDb.OleDbException: Service is not running.

 

That told me that the windows indexing or windows search was not running. I didn’t figure that the connection string would be wrong.  Oh and there is no catalog created when you index files on server 2008.  You have to reference them this way:

 

SELECT filename blah blah FROM systemindex..scope() WHERE SCOPE=‘file:C:\inetpub\cgweb\appname\repository’

 

You also have to not include the directory folders like this:

 

AND system.itemtype NOT LIKE ‘%Directory%’

 

I guess that can be chalked up as lessons learned.  Don’t look for the obvious, look of the unobvious. Hope this helps you.  Have fun coding and as always, if there are any questions or suggestions, they are welcome.  Thank you.

Learning MVC: LINQ to SQL

I am in the process of watching a video about pulling back records form a database using LINQ to SQL.  This is new functionality that comes in .NET 3.0 or 3.5 (not exactly sure which one). I do know MVC is not available to use unless you have Framework 3.5 installed so we will go with that anyway. I was just looking at a video that indicate there are two ways to run a ‘query’ using LINQ to SQL.  Below are the two ways. We were working with movies so the queries are for movies. Here they are:

 

Query Syntax:

Dim movies = From m In dataContext.Movies Select m

 

Method Syntax:

Dim movies = dataContext.Movies.Select(Function(m) m)

 

Both of the statements pull back all rows from the movies table. Pretty crazy if you ask me.  I personally like the first statement.  It is easier to read in my opinion.  I will be venturing into learning MVC with the help of several people (Scott Guthrie, Stephan Walther, and Scott Hanselman amoung others [Google]). I don’t think there are many books out on it yet.  I am usign MVC release candidate currently. As I go through the steps of learning I will post what I learn. I will also post the steps to getting to this point at a later date. Have fun coding and as always, if there are any questions or suggestions, they are welcome. Thank you.

Posted in MVC. Tags: , , . 2 Comments »