G
Guest
private void RDAPull(
if (!System.IO.File.Exists(@"\My Documents\MSFA.sdf")
//File.Delete("MSFA.sdf")
SqlCeEngine eng = new SqlCeEngine(@"Data Source=\My Documents\MSFA.sdf")
eng.CreateDatabase()
SqlCeConnection cn = new SqlCeConnection(@"Data Source =\My Documents\MSFA.sdf")
SqlCeCommand cmd = new SqlCeCommand("DROP TABLE Customer", cn)
cn.Open()
tr
cmd.ExecuteNonQuery()
catch(Exception){
cn.Close()
cn.Dispose()
SqlCeRemoteDataAccess rda = new SqlCeRemoteDataAccess()
string sCon = @"Provider=SQLOLEDB; DataSourve=MySvr;
+ @"Initial Catalog=MSFA;integrated security=SSPI;
+ @"Persist Security Info=False"
rda.InternetUrl = @"http://MySvr/MSFA/sscesa20.dll"
rda.LocalConnectionString = @"Data Source =\My Documnets\MSFA.sdf"
tr
rda.Pull("Customer", "SELECT * FROM Customer", sCon, RdaTrackOption.TrackingOn, "rdaCustomerErrors")
catch (Exception e ){e.ToString();
rda.Dispose()
Above is the code for pull the table from SQL Server 2000 database to SQL Server CE database. Does it correct ??
I've few questions here about RDA
1. In the "string sCon" how to know what should put at data source ??. Is it Initial Catalog is the database name ?
for integrated security, is it must specify ?? If let say I does not use SSPI, How should I code it ?? Is it like
integrated security = ""
2. I use SQL Server Connectivity Management Tool to create a virtual directory contaning the SQL Server CE Server Agent DDL (Sscesa20.dll
I've choose to use integrated windows authendication, so for NTFS Access Permission User I put HONG\leong Yau Hong, where HONG is my computer nam
na dleong yau hong is my windows user account. After the Installation finish, does it means also I've succefully install th
SQL Server CE Server Agent on my Web server ?
3. By default, the SQL Server CE Server Agent is locate at "c:\Program Files\Microsoft SQL Server CE 2.0\Server\"
Is it this is the directory I should put in above code - "rda.InternetUrl ??
4. How to know that the SQL Server CE Agent is install on my Web Server. For your information, I use "IIS" as Web Server is it ok ?
I right click my computer, click manage, then it display "Computer Management". I expand Services and Applications I see Microsoft SQL Server CE folder
Besides, I also expand the "Internet Information Service", expand WebSites and Default Web Site, I saw the Folder that I specify at Virtual Directory Alias and Content
Folder in SQL Server CE Virtual Diractory Creation Wizard
5. Can RDA work on Emulator ?
6. If I wnat to pull more than one table, let say "Catalog" table, is it I just put below code ?
rda.Pull("Customer", "SELECT * FROM Customer", sCon, RdaTrackOption.TrackingOn, "rdaCustomerErrors")
rda.Pull("Catalog", "SELECT * FROM Catalog", sCon, RdaTrackOption.TrackingOn, "rdaCatalogErrors")
7. Last Question, Normally Where should I place the RDAPull code ?? Is it at FormLoad or at Constructor ?
Thanks very muc
if (!System.IO.File.Exists(@"\My Documents\MSFA.sdf")
//File.Delete("MSFA.sdf")
SqlCeEngine eng = new SqlCeEngine(@"Data Source=\My Documents\MSFA.sdf")
eng.CreateDatabase()
SqlCeConnection cn = new SqlCeConnection(@"Data Source =\My Documents\MSFA.sdf")
SqlCeCommand cmd = new SqlCeCommand("DROP TABLE Customer", cn)
cn.Open()
tr
cmd.ExecuteNonQuery()
catch(Exception){
cn.Close()
cn.Dispose()
SqlCeRemoteDataAccess rda = new SqlCeRemoteDataAccess()
string sCon = @"Provider=SQLOLEDB; DataSourve=MySvr;
+ @"Initial Catalog=MSFA;integrated security=SSPI;
+ @"Persist Security Info=False"
rda.InternetUrl = @"http://MySvr/MSFA/sscesa20.dll"
rda.LocalConnectionString = @"Data Source =\My Documnets\MSFA.sdf"
tr
rda.Pull("Customer", "SELECT * FROM Customer", sCon, RdaTrackOption.TrackingOn, "rdaCustomerErrors")
catch (Exception e ){e.ToString();
rda.Dispose()
Above is the code for pull the table from SQL Server 2000 database to SQL Server CE database. Does it correct ??
I've few questions here about RDA
1. In the "string sCon" how to know what should put at data source ??. Is it Initial Catalog is the database name ?
for integrated security, is it must specify ?? If let say I does not use SSPI, How should I code it ?? Is it like
integrated security = ""
2. I use SQL Server Connectivity Management Tool to create a virtual directory contaning the SQL Server CE Server Agent DDL (Sscesa20.dll
I've choose to use integrated windows authendication, so for NTFS Access Permission User I put HONG\leong Yau Hong, where HONG is my computer nam
na dleong yau hong is my windows user account. After the Installation finish, does it means also I've succefully install th
SQL Server CE Server Agent on my Web server ?
3. By default, the SQL Server CE Server Agent is locate at "c:\Program Files\Microsoft SQL Server CE 2.0\Server\"
Is it this is the directory I should put in above code - "rda.InternetUrl ??
4. How to know that the SQL Server CE Agent is install on my Web Server. For your information, I use "IIS" as Web Server is it ok ?
I right click my computer, click manage, then it display "Computer Management". I expand Services and Applications I see Microsoft SQL Server CE folder
Besides, I also expand the "Internet Information Service", expand WebSites and Default Web Site, I saw the Folder that I specify at Virtual Directory Alias and Content
Folder in SQL Server CE Virtual Diractory Creation Wizard
5. Can RDA work on Emulator ?
6. If I wnat to pull more than one table, let say "Catalog" table, is it I just put below code ?
rda.Pull("Customer", "SELECT * FROM Customer", sCon, RdaTrackOption.TrackingOn, "rdaCustomerErrors")
rda.Pull("Catalog", "SELECT * FROM Catalog", sCon, RdaTrackOption.TrackingOn, "rdaCatalogErrors")
7. Last Question, Normally Where should I place the RDAPull code ?? Is it at FormLoad or at Constructor ?
Thanks very muc