Saturday, February 25, 2012

RDA Error:Failure setting up a non parameterized query, possible incorrect SQL query

I receive this error :

Failure setting up a non parameterized query, possible incorrect SQL query

any 1 can help me plz?

here is my code :

string strDBFile = DBPath;

string strConnLocal = DBConnection;

string strConnRemote = "Provider=sqloledb; "

+ "Data Source=AMNEH; "

+ "Initial Catalog=SIS; "

+ "Integrated Security=SSPI;";

string strURL = "http://" + ipAddress + "/" + virtualDirectory + "/sqlcesa30.dll";

SqlCeRemoteDataAccess rdaNW = new SqlCeRemoteDataAccess();

try

{

rdaNW.LocalConnectionString = strConnLocal;

rdaNW.InternetUrl = strURL;

rdaNW.InternetLogin = "";

rdaNW.InternetPassword = "";

string select = "select * from tabel1 where field1=326";

rdaNW.Pull("tabel1",select,

strConnRemote,

RdaTrackOption.TrackingOnWithIndexes,

"ErrorLog");

}

catch (SqlCeException exSQL)

{

MessageBox.Show("HRESULT:" + exSQL.HResult.ToString() + ",\nNativeError:" + exSQL.NativeError.ToString() + ",\nMessage:" + exSQL.Message);

}

finally

{

rdaNW.Dispose();

}

There is no obvious error with your select query but there are a number of things that can be setup incorrectly when doing RDA. Did you remove the table from the SQL CE database before running this code? I have answered dozens of questions in this forum and on microsoft.public.sqlserver.ce on the topic of troubleshooting RDA. You can use Google Advanced Group Search to search for the posts that apply to RDA.

Darren

No comments:

Post a Comment