Estoy intentando escribir un sitio web simple (ASP.NET v4), que llamará a Windows Search, buscará un archivo específico y se lo devolverá al usuario. He creado el siguiente ejemplo: se llama al servicio de búsqueda de Windows en "remoteserver", y devuelve la ruta de "Unarchivo.txt":El código OLEDB de ASP.NET se rompe cuando se implementa en IIS7
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = "Provider=Search.CollatorDSO;Extended Properties='Application=Windows';";
OleDbCommand cmd = conn.CreateCommand();
cmd.CommandText = string.Format(
"SELECT System.ItemPathDisplay, System.ItemType FROM " +
" sytelhp.systemindex WHERE SCOPE='file://remoteserver/archive' AND CONTAINS(\"System.FileName\", " +
" '\"*{0}*\"')", "somefile.txt");
conn.Open();
OleDbDataReader rdr = cmd.ExecuteReader();
string result=rdr[0].ToString();
.. y esto funciona muy bien en Visual Studio 2010 entorno de desarrollo, "resultado" contiene la ruta al archivo. Sin embargo, si despliego al servidor IIS7 locales (que se ejecuta en el servidor 2008), me sale este error:
The parameter is incorrect.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: The parameter is incorrect.
Estoy en una pérdida a dónde ir después. ¿Qué debo hacer con IIS7, o el código, o ambos para que funcione? De nuevo, esto funciona bien dentro de VS2010 (probado tanto en Windows 7 como en Windows 2008 Server).
¿Qué es *** sytelhp.systemindex ***? – Kiquenet
Era el nombre del servidor que ejecutaba el código. Esto fue hace 6 años :) – KenD