J
Jesper Stocholm
Hi all,
I am trying to access our index server via ASP.Net, but it keeps
throwing exceptions when I do my search. I have tried with OleDB and
ADO, but they both throw exceptions.
Can you help me figure out, what I am doing wrong?
ADO.Net:
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();
System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand();
conn.ConnectionString = "Provider=MSIDX";
cmd.Connection = conn;
cmd.CommandText = "SELECT * FROM ...";
conn.Open();
System.Data.SqlClient.SqlDataReader rdrSearch = cmd.ExecuteReader();
Exception:
Keyword not supported: 'provider'.
OleDB:
System.Data.OleDb.OleDbConnection odbSearch = new System.Data.OleDb.OleDbConnection();
System.Data.OleDb.OleDbCommand cmdSearch = new System.Data.OleDb.OleDbCommand();
odbSearch.ConnectionString = "Provider=\"MSIDXS\";Data Source=\"[Web]\";";
cmdSearch.Connection = odbSearch;
cmdSearch.CommandText = "SELECT * FROM ..."
odbSearch.Open();
System.Data.OleDb.OleDbDataReader rdrSearch = cmdSearch.ExecuteReader();
Exception:
IErrorInfo.GetDescription failed with REGDB_E_CLASSNOTREG
What am I missing here?
Thanks,
)
I am trying to access our index server via ASP.Net, but it keeps
throwing exceptions when I do my search. I have tried with OleDB and
ADO, but they both throw exceptions.
Can you help me figure out, what I am doing wrong?
ADO.Net:
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();
System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand();
conn.ConnectionString = "Provider=MSIDX";
cmd.Connection = conn;
cmd.CommandText = "SELECT * FROM ...";
conn.Open();
System.Data.SqlClient.SqlDataReader rdrSearch = cmd.ExecuteReader();
Exception:
Keyword not supported: 'provider'.
OleDB:
System.Data.OleDb.OleDbConnection odbSearch = new System.Data.OleDb.OleDbConnection();
System.Data.OleDb.OleDbCommand cmdSearch = new System.Data.OleDb.OleDbCommand();
odbSearch.ConnectionString = "Provider=\"MSIDXS\";Data Source=\"[Web]\";";
cmdSearch.Connection = odbSearch;
cmdSearch.CommandText = "SELECT * FROM ..."
odbSearch.Open();
System.Data.OleDb.OleDbDataReader rdrSearch = cmdSearch.ExecuteReader();
Exception:
IErrorInfo.GetDescription failed with REGDB_E_CLASSNOTREG
What am I missing here?
Thanks,
)