virtual techdays INDIA │ august 2010 Building ASP.NET applications using SQL Server Compact Chaitanya Solapurkar │ Partner Technical Consultant, Microsoft Global Partner Services
Introduction to SQL Server Compact What is it? Scenarios Demonstration of creating and working with a SQL Server Compact Database SQL Server Compact and ASP.NET What’s new in SQL Server Compact 4.0? Demonstration of using SQL Server Compact in ASP.NET application Additional Features and Considerations Getting Connected Accessing Data Deployment virtual techdays INDIA │ august 2010 S E S S I O N A G E N D A
3 Notes (hidden)
virtual techdays INDIA │ august 2010 ClientsServers Cloud Synchronizing data from the point of activity to the data center SQL Server
virtual techdays INDIA │ august 2010 SQL Server Compact
User Code within the Database Stored Procs User Defined Functions CLR within the database Out of proc If the hosting app isn’t running, the database isn’t running Out of proc achieved through developer defined Windows Service Multiple User Roles Application will manage security rights to the database virtual techdays INDIA │ august 2010 SQL Server Compact Does not Target
virtual techdays INDIA │ august 2010 Evolution of SQL Server Compact‘06‘01‘05‘07‘03‘08‘10
virtual techdays INDIA │ august 2010 DEMO: Creating SQL Server Compact Database
Support for ASP.NET Virtual Memory Reduction Higher Reliability Encryption Algorithm Update Medium Trust Support for Paging Queries Deployment Enhancements Integration with ADO.NET EF 4.0* virtual techdays INDIA │ august 2010 SQL Server Compact and ASP.NET What’s new in SQL Server Compact 4.0?
Small size, easy to download and no setup configuration needed to install End-to-end development and deployment experience in Visual Studio Easily deployed using xcopy (private deployment) Embedded in the application and no process overhead Supports multiple read and write connections to the database Seamless migration of schema and data to SQL Server Fully functional embedded database with support for indexes, referential integrity constraints etc. Works in medium trust Tuned for stress and performance for website load virtual techdays INDIA │ august 2010 SQL Server Compact and ASP.NET Advantages of Compact in ASP.NET
virtual techdays INDIA │ august 2010 SQL Server Compact and ASP.NET Server Explorer Query Designer Transact-SQL Editor Dataset Configuration, Entity Framework Web Forms Drag and drop of SQL Compact tables on Web Forms Project based code generating designers Click Once Web (MS) deploy Application deployment designers Project upgrade,and add new or an existing Local Database New item template for Compact in Web projects Add SDF file in App_Data Other project based miscellaneous designers Paid VS SKUs: Pro, Premium, Ultimate Free: C# Express, VB Express and Visual Web Developer Express VS SKU support Tooling in Visual Studio
virtual techdays INDIA │ august 2010 DEMO: ASP.NET and SQL Server Compact 4.0
SqlCeConnectionString… File path Specifies password And options e.g. Encryption Mode, Max Database Size, Mode(R/W), Autoshrink Use |DataDirectory| macro To resolve obfuscated.SDF database file location Use “Max database size” for larger databases Defaults to 128MB for devices and 256 MB for desktop virtual techdays INDIA │ august 2010 SQL Server Compact Getting Connected
ADO.NET Entity Framework Create database using code first Support for server generated keys ADO.NET EF CTP4 available for download Paging queries T-SQL syntax added for OFFSET and FETCH Typed DataSets & TableAdapters SqlCeResultset – Scrollable & Updateable Cursors virtual techdays INDIA │ august 2010 SQL Server Compact Accessing Data
Change Managed Provider reference to Copy Local = true Include both 32 and 64 bit Compact engine DLLs Place 32bit version under an X86 Place 64bit version under AMD64 AMD64 includes Intel X64 Folder Name based off: Copy the DLLs from the private folder virtual techdays INDIA │ august 2010 SQL Server Compact Deployment Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE")
It’s free, fast, safe/encryptable and compact It’s easy to program and manage Single file, code free, doc centric file format It’s an alternative to JET, XML persisted DataSets, SQL Server Express It’s integrated into: Visual Studio 2010 WebMatrix Beta It provides for seamless migration of schema and data to SQL Server virtual techdays INDIA │ august 2010 Summary SQL Server Compact
virtual techdays INDIA │ august 2010 RESOURCES SQL Server Compact Team Blog Latest updates from the SQL Server Compact Team and also some tips and tricks. SQL Server Compact 4.0 Community Technology Preview Download of SQL Server Compact 4.0 CTP SQL Compact Toolbox GUI Tool to work with SQL Compact 4.0 CTP Everything SQL Server Compact Blog with updates and tips on SQL Server Compact
virtual techdays INDIA │ august 2010 RELATED CONTENT Data Driven – Master/Details Business Forms Amar Nityananda 19 th August 2010, 3:00pm - 4:00pm ASP.NET 4.0 Core Runtime Enhancements Sundararajan S 19 th August 2010, 4:15pm - 5:15pm Data-Tier Application in Visual Studio 2010 Abhishek Kala 19 th August 2010, 4:15pm - 5:15pm
virtual techdays THANKS │ august 2010