Question

Can someone please help me understand how to setup the connectionString and the InternetURL necessary for the RemoteDataAccess?

I can't find any material with some good examples and explanations.

Thank you.

I tried with the following code, but i get the error in the connection string pass in the pull procedure. Can i call an mdf file with oledb provider?

String rdaOlebConnectionString = @"Data Source=\ProgramStore\Program Files\SyncTable\ssce.sdf";
String connectionStr = @"Data Source=192.168.77.160;Initial Catalog=Autotrolej;Persist Security Info=True;User Id=martina; Password=martina";

rda = new SqlCeRemoteDataAccess();
            rda.LocalConnectionString = rdaOlebConnectionString;
            rda.InternetUrl = "http://localhost:5011/Pidion/sqlcese35.dll ";
            rda.Pull("EXP.Vozilo", "SELECT * FROM EXP.Vozilo", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=192.168.77.160;Initial Catalog=Autotrolej;Persist Security Info=True;User ID=martina;Password=martina");


            rda.Dispose();
Was it helpful?

Solution

Try this connection string .. First make a test form with four text labels. Database server, database name, user id and password

private void button_test_Click(object sender, EventArgs e)
{
    try
    {
        string str = "data source=" + textBox_server.Text + "; initial catalog=" + textBox_db.Text
+ "; user id=" + textBox_user.Text + "; pwd=" + textBox_password.Text + ";";

        SqlConnection sqlcon = new SqlConnection(str);
        sqlcon.Open();
        sqlcon.Close();
        MessageBox.Show("Test Connection was successfull");
    }
    catch (Exception ex)
    {
        MessageBox.Show("Test Connection failed. "+ ex.Message);
    }
}

then add this and test .

Please use the correct database name and server, and please do check regarding the authentication of serve

While doing the remote connection at that time please make sure to enter correct database server name or ip of it, and correct table name. With this test you can verify the connection from c# to your code

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top