Create database in windows mobile but dont create password
-
Create database in windows mobile but when i run doesn't create password so exception for password mismatch.If i Create database in windows mobile it works fine... How solve it... Plz Help me . this is my first project of windows mobile. Code is given below: DataTable dt = new DataTable("ServerSettings"); dt.ReadXmlSchema(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + ("\\ServerInformation.bin")); dt.ReadXml(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + ("\\ServerInformation.bin")); SqlCeReplication repl = new SqlCeReplication(); repl.InternetUrl = @"http://" + dt.Rows[0]["PCName"].ToString() +"/DBRestaurant/sqlcesa30.dll"; repl.Publisher = dt.Rows[0]["PCName"].ToString(); repl.PublisherDatabase = @"DBRestaurant"; repl.PublisherSecurityMode = SecurityType.DBAuthentication; repl.PublisherLogin = @"sa"; repl.PublisherPassword = dt.Rows[0]["PublicatrionPassword"].ToString(); repl.Publication = @"DBRestaurant"; repl.Subscriber = @"DBRestaurant"; repl.SubscriberConnectionString = @"Data Source=""My documents\DBRestaurant.sdf"";Password=" + dt.Rows[0]["SubscriptionPassword"].ToString() + ";Max Database Size=128;Default Lock Escalation =100;"; try { if(!System.IO.File.Exists("My documents\\DBRestaurant.sdf")) repl.AddSubscription(AddOption.CreateDatabase); repl.Synchronize(); } catch (SqlCeException e) { System.Windows.Forms.MessageBox.Show(e.ToString()); }
-
Create database in windows mobile but when i run doesn't create password so exception for password mismatch.If i Create database in windows mobile it works fine... How solve it... Plz Help me . this is my first project of windows mobile. Code is given below: DataTable dt = new DataTable("ServerSettings"); dt.ReadXmlSchema(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + ("\\ServerInformation.bin")); dt.ReadXml(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + ("\\ServerInformation.bin")); SqlCeReplication repl = new SqlCeReplication(); repl.InternetUrl = @"http://" + dt.Rows[0]["PCName"].ToString() +"/DBRestaurant/sqlcesa30.dll"; repl.Publisher = dt.Rows[0]["PCName"].ToString(); repl.PublisherDatabase = @"DBRestaurant"; repl.PublisherSecurityMode = SecurityType.DBAuthentication; repl.PublisherLogin = @"sa"; repl.PublisherPassword = dt.Rows[0]["PublicatrionPassword"].ToString(); repl.Publication = @"DBRestaurant"; repl.Subscriber = @"DBRestaurant"; repl.SubscriberConnectionString = @"Data Source=""My documents\DBRestaurant.sdf"";Password=" + dt.Rows[0]["SubscriptionPassword"].ToString() + ";Max Database Size=128;Default Lock Escalation =100;"; try { if(!System.IO.File.Exists("My documents\\DBRestaurant.sdf")) repl.AddSubscription(AddOption.CreateDatabase); repl.Synchronize(); } catch (SqlCeException e) { System.Windows.Forms.MessageBox.Show(e.ToString()); }
Wrong forum
himanshu