Monday, March 19, 2012

Auhtentification problem with Remote Data Access

Hello

I try to make a pull operation from an SQL SERVER 2005 database to a SQL Mobile 2005. I set Integrated authentification on IIS and SQL SEvrer authentification in the database. It passes the IIS authentification, but not the sql Server one. In addition, I tried to connect directlly to the sql with the same connection string anf it works.

Can you help me with this? Do i have to extra configure that dll(the agent) in the virtual directory, or sometihng llike that?

This is my code:

// Connection String to the SQL Server

//

string rdaOleDbConnectString = "Data Source=Sql07;Initial Catalog=AdventureWorks; " +

"User Id=sa;Password = sql250";

SqlConnection conn = new SqlConnection(rdaOleDbConnectString);

conn.Open();

// Initialize RDA Object

//

SqlCeRemoteDataAccess rda = null;

try

{

// Try the Pull Operation

//

rda = new SqlCeRemoteDataAccess(

"http://192.168.0.79/SqlMobileReplication/sqlcesa30.dll",

"assolutions\\dan.popescu",

"password",

"Data Source=\\my documents\\Baza.sdf");

rda.Pull("Employees", "SELECT * FROM DimEmployee", rdaOleDbConnectString,

RdaTrackOption.TrackingOnWithIndexes, "ErrorTable");

// or, try one of these overloads:

//

// rda.Pull("Employees", "SELECT * FROM DimEmployee", rdaOleDbConnectString,

// RdaTrackOption.TrackingOnWithIndexes);

//

// rda.Pull("Employees", "SELECT * FROM DimEmployee", rdaOleDbConnectString);

}

catch (Exception ex)

{

// Handle errors here

//

}

finally

{

// Dispose of the RDA object

//

rda.Dispose();

}

You can see that I have tried the connection first, and it really works. Isn't it the same thing it's doing at replication?

What is the error you are getting?
Also are you sure that the server has the table DimEmployee in the database?

No comments:

Post a Comment