Using RDA in VS .NET

Creation Code 128B in VS .NET Using RDA
83 Using RDA
Code 128C Drawer In VS .NET
Using Barcode maker for .NET framework Control to generate, create Code-128 image in VS .NET applications.
TABLE 81: Methods and Properties of the SqlCeRemoteDataAccess Class
Recognize Code 128A In VS .NET
Using Barcode scanner for VS .NET Control to read, scan read, scan image in VS .NET applications.
Name
Paint Barcode In Visual Studio .NET
Using Barcode creator for Visual Studio .NET Control to generate, create barcode image in Visual Studio .NET applications.
Comment
Decode Barcode In .NET
Using Barcode recognizer for .NET framework Control to read, scan read, scan image in Visual Studio .NET applications.
Methods
Painting Code 128 In C#.NET
Using Barcode encoder for VS .NET Control to generate, create Code-128 image in .NET applications.
Pull
Printing Code 128 In VS .NET
Using Barcode drawer for ASP.NET Control to generate, create Code 128 Code Set B image in ASP.NET applications.
Submits a SELECT statement to a SQL Server database Creates a table and indexes in a SQL Server CE database to hold the selected data Retrieves the selected rows and inserts them into the table Initiates tracking of changes made to the selected data Submits changes made to previously pulled data back to the SQL Server Receives errors from the SQL Server and stores them in an applicationspecified error table Submits SQL statements to a SQL Server
USS Code 128 Encoder In VB.NET
Using Barcode printer for Visual Studio .NET Control to generate, create Code 128 image in Visual Studio .NET applications.
Push
Print DataMatrix In .NET Framework
Using Barcode printer for .NET Control to generate, create ECC200 image in .NET applications.
SubmitSQL
Printing Bar Code In VS .NET
Using Barcode creation for .NET Control to generate, create barcode image in .NET applications.
Properties
Generating GTIN - 128 In .NET
Using Barcode generation for Visual Studio .NET Control to generate, create EAN / UCC - 13 image in VS .NET applications.
InternetLogon InternetPassword InternetProxyLogon InternetProxyPassword InternetProxyServer InternetURL
Bar Code Encoder In Visual Studio .NET
Using Barcode generator for .NET Control to generate, create bar code image in .NET applications.
Internet username Internet user password Proxy username Proxy password Proxy server name URL of the sscesa20dll file at a Web site (ie, the virtual directory specified in the Virtual Directory Alias and Content Folder dialog box of the Virtual Directory Creation Wizard Connection string for the SQL Server CE database
Code 11 Creator In VS .NET
Using Barcode generator for VS .NET Control to generate, create Code 11 image in VS .NET applications.
LocalConnectionString
Creating ANSI/AIM Code 39 In Visual C#.NET
Using Barcode creation for VS .NET Control to generate, create Code 39 image in VS .NET applications.
8321 Pulling Data
Encode Bar Code In VB.NET
Using Barcode creator for .NET framework Control to generate, create barcode image in .NET framework applications.
The Pull method submits a SQL SELECT statement to the SQL Server for processing The method creates the table to hold the returned rows; that table must not already exist Some of the information the Pull method needs is specified by setting properties before invoking the method; some is supplied through the parameters, which are shown in Table 82 For example, the code shown in Listing 81 pulls information from the Northwind Categories table and stores it in a newly created table that is
Printing ECC200 In Java
Using Barcode generator for Java Control to generate, create Data Matrix ECC200 image in Java applications.
Synchronizing Mobile Data
Bar Code Creation In Java
Using Barcode drawer for Java Control to generate, create barcode image in Java applications.
also to be named Categories Listings 81 through 85 show the code that you can find in the RDA project at the book s Web site
Encode Code 39 Extended In VB.NET
Using Barcode drawer for Visual Studio .NET Control to generate, create Code 3/9 image in VS .NET applications.
Listing 81: An RDA Pull
Barcode Printer In VB.NET
Using Barcode creator for VS .NET Control to generate, create barcode image in .NET applications.
// The database file private string strDBFile = @"My Documents\Northwindsdf"; // The local connection string private string strConnLocal = "Data Source=" + @"My Documents\Northwindsdf"; // The remote connection string private string strConnRemote = "Provider=sqloledb; " + "Data Source=Snowden; " + "Initial Catalog=Northwind; " + "Integrated Security=SSPI;"; // The URL private string strURL = "http://20720216830/YaoDurantRDA/sscesa20dll";
Bar Code Creation In C#
Using Barcode creator for VS .NET Control to generate, create bar code image in .NET applications.
private void mitemPull_Click(object sender, EventArgs e) { // Create an RDA object SqlCeRemoteDataAccess rdaNW = new SqlCeRemoteDataAccess(); try { // Have RDA: // Create local tables named Categories and // ErrorCategories // Connect to the remote server and submit the // SELECT statement // Place the results in the local Categories table rdaNWLocalConnectionString = strConnLocal; rdaNWInternetUrl = strURL; rdaNWInternetLogin = ""; rdaNWInternetPassword = ""; rdaNWPull("Categories", "SELECT CategoryID, CategoryName " + " FROM Categories", strConnRemote, RdaTrackOptionTrackingOnWithIndexes, "ErrorCategories"); } catch(SqlCeException exSQL) { HandleSQLException(exSQL);
Draw ECC200 In C#
Using Barcode generation for Visual Studio .NET Control to generate, create Data Matrix 2d barcode image in .NET applications.
83 Using RDA
} finally { rdaNWDispose(); }
TABLE 82: Parameters of the Pull Method
Parameter
localTableName sqlSelectString oledbConnectionString trackOptions
Comment
Name of the SQL Server CE table to be created to receive the output of the SELECT statement The SELECT statement The connection string used to access the SQL Server database An enumerated indicator specifying whether changes to the data in the table should be tracked so that they can be subsequently pushed back to the SQL Server Also specifies whether indexes should be created on the local table The name of a table to be created in the local database that holds errors returned by subsequent pushes
errorTable
8322 Fixing the IDENTITY Property
When you pull a table from SQL Server down to your device using RDA, the schema of that table is brought with the data so that the table can be created on the device That schema might be incorrect regarding the IDENTITY property If the SQL Server table has an IDENTITY property column, the new SQL Server CE table also has that column designated as an IDENTITY property column, but its seed and increment are always set to (1,1) You must initially correct them to the values you want, as shown in Listing 82
Listing 82: Setting the IDENTITY Property Column s Seed Value
// The IDENTITY property seed value of the new table // is at 1, even after the retrieved rows have // been added to the table "Fix" it SqlCeConnection connLocal = new SqlCeConnection(strConnLocal); connLocalOpen();
Synchronizing Mobile Data
SqlCeCommand cmndLocal = new SqlCeCommand(); int intMaxCategoryID; try { cmndLocalConnection = connLocal; // Retrieve the highest CategoryID in the table cmndLocalCommandText = "SELECT max(CategoryID) FROM Categories"; string strMaxCategoryID = cmndLocalExecuteScalar()ToString(); intMaxCategoryID = intParse(strMaxCategoryID); // Set the seed one higher cmndLocalCommandText = "ALTER TABLE Categories " + "ALTER COLUMN CategoryID IDENTITY (" + (intMaxCategoryID + 1)ToString() + ",1)"; cmndLocalExecuteNonQuery(); } catch( SqlCeException exSQL ) { HandleSQLException(exSQL); } finally { connLocalClose(); }
Be aware that the auto-generated CategoryID value of any rows that you insert into the local Categories table is always overridden with a new value when those rows are pushed to the host server