Tuesday, May 11, 2010

SQL 2008 DB Dev 70-433 2nd objective Programming Objects Code Crackin #24

Hey Now Everybody,

This is a review of the second objective on the Microsoft exam 70-433 ‘Programming Objects’

While reviewing for the Microsoft exams it’s enjoyable to combine the three sections:
1. Self Paces Book’s chapters content
2. Code, SQL Scripts
3. Concepts from Questions of the Microsoft Training Kit

2 Implementing Programming Objects (16 percent)

2.1 Create & Alter Stored Procedures
2.2 Create & Alter User-Defined Functions UDFs
2.3 Create & Alter DML Triggers
2.4 Create & Alter DDL Triggers
2.5 Create & Deploy CLR-Based Objects c7.2
2.6 Implement Error handling c5.1
2.7 Manage Transactions

Book Chapters Concepts

2.1 Stored Procedures

A stored procedure is a batch of T-SQL code that has a name & stored in db
We can pass parameters to a proc either by name or by position. We can also return data from procs using output params.
We can use the EXECUTE AS clause to cause a proc to execute under a specific security context
Cursors allow us to process data on a row by row basis. However they may not be the most efficient
Try .. Catch blocks provide error handling.

2.2 UDF’s User-Defined Functions
We can create scalar functions, inline table-valued functions & multi –statement table-valued functions.
The function body must be encloded w/in a Begin END block with the exception of inline table-valued functions
Return statement terminates all functions
Functions are not allowed to change the stae of a db or a SQL Server instance.

2.3 DML Triggers – execute when we Add, modify, or remove rows
2.4 DDL Triggers
Triggers are sps that automatically execute in response to DDL or DML events
We can create 3 types of triggers DML, DDL & logon triggers
DML execute when an Insert, update or delete statement occurs
DDL triggers execute when a DDL statement for which the trigger is coded for occurs.
Logon triggers execute when there is a logon attempt
We can access the Interted & deleted tables with a DML Trigger
We can access the XML document provided by the EVENTDATA function w/in a DDL or logon trigger.

2.5 CLR-Based Objects C7.2
SQLCLR must be enabled on the SQL Server Interface when using user-defined objects based on SQLCLR
Objects for development using SQLCLR are UDFs & user-defined aggregates
If we create UDTs based on SQLCLR make sure we test
Filestream can be used when the relevant data mostly involves storing streams larger than a meg (1MB)

2.6 Error Handling
Try Catch blocks
2.7 Manage Transactions

Code –

Stored Procedure Example


USE [ccatto_aspnetdb]
GO /****** Object: StoredProcedure [dbo].[aspnet_UsersInRoles_IsUserInRole] Script Date: 05/11/2010 21:01:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER< OFF

GO
ALTER PROCEDURE [dbo].[aspnet_UsersInRoles_IsUserInRole]
@ApplicationName nvarchar(256)
, @UserName nvarchar(256)
, @RoleName nvarchar(256)
AS
BEGIN
DECLARE @ApplicationId uniqueidentifier
SELECT @ApplicationId = NULL
SELECT @ApplicationId = ApplicationId
FROM aspnet_Applications
WHERE LOWER(@ApplicationName) = LoweredApplicationName
IF (@ApplicationId IS NULL)

RETURN(2)
DECLARE @UserId uniqueidentifier
SELECT @UserId = NULL
DECLARE @RoleId uniqueidentifier
SELECT @RoleId = NULL
SELECT @UserId = UserId
FROM dbo.aspnet_Users
WHERE LoweredUserName = LOWER(@UserName)
AND ApplicationId = @ApplicationId
IF (@UserId IS NULL)
RETURN(2)
SELECT @RoleId = RoleId
FROM dbo.aspnet_Roles
WHERE LoweredRoleName = LOWER(@RoleName)
AND ApplicationId = @ApplicationId
IF (@RoleId IS NULL)
RETURN(3)
IF (EXISTS(
SELECT *
FROM dbo.aspnet_UsersInRoles
WHERE UserId = @UserId
AND RoleId = @RoleId ))
RETURN(1)
ELSE
RETURN(0)
END

Function Generic Example

CREATE FUNCTION <Inline_Function_Name, sysname, FunctionName>
(
-- Add the parameters for the function here
<@param1, sysname, @p1> <Data_Type_For_Param1, , int>,
<@param2, sysname, @p2> <Data_Type_For_Param2, , char>
)
RETURNS TABLE
AS
RETURN
(
-- Add the SELECT statement with parameter references here
SELECT 0
)
GO

Trigger Generic example from MSDN library

CREATE TRIGGER reminder
ON titles
FOR INSERT, UPDATE, DELETE
AS
EXEC master..xp_sendmail 'MaryM',
'Don''t forget to print a report for the distributors.'
GO

A few Questions Concepts:

1 Instead of Delete Trigger

2 Create a DDL Trigger to populate a table

3 Rollback & Commit

BEGIN TRANSACTION;
DECLARE @success int;
EXEC @success = spName;
IF @success = 0
ROLLBACK;
ELSE
COMMIT;

4 Alter a trigger –

5 A user-defined function (UDF) can be used directly within a SELECT statement.

6 create a UDF with the SCHEMABINDING option

7 Using Try Catch Blocks

Next Up section three Query Fundamentals.
That is all there will be more,

As always all comments welcome,

Catto

DB Dev 70-433 Implementing Tables & Views Code Crackin #23

Hey Now Everybody,

This is a review of the first objective on the Microsoft exam 70-433 ‘Implementing Tables & View’

While reviewing for the Microsoft exams it’s enjoyable to combine the three sections:
1. Self Paces Book’s chapters content
2. Code, SQL Scripts
3. Concepts from Questions of the Microsoft Training Kit

Objective: Implementing Tables & Views

1. Implementing Tables & Views (14 percent)
1.1 Create & Alter Tables 3.1
1.2 Create & Alter Views 5.4
1.3 Create & Alter Indexes 6.2
1.4 Create & modify Constraints 3.2
1.5 Implement Data Types C3.1 & 8.1
1.6 Implement partitioning solutions c6.2

During this series I plan on using the ASP.NET membership database for many of the examples. The reason for choosing this db is since it’s a public database & used in real world apps more so than the sample db’s such as northwind or AdventureWorks.

clip_image002

1. Implementing Tables & Views (14 percent)
1.1 Create & Alter Tables 3.1

Creating tables is not just defining columns. We have to choose data types correctly & implement data integrity.
Data types & how they behave is an important skill so we can use them correctly.
Data integrity is important to protect your data.

1.2 Create & Alter Views c5.4

A view is a select statement stored in the db
Views return a single result & cannot use temp tables
We can update data though a view
If a view doesn’t meet requirements for data alters, we can create an INSTEAD OF trigger to process the data modification instead.
A portioned view can be created by using a UNION ALL on two tables
Distributed partitioned views use linked servers to combine multiple tables across servers.
We can create a unique, clustered index on a view to improved performance.

1.3 Create & Alter Indexes 6.2

Indexes typically help read performance but hurt writing performance
Indexed views can increase performance.
It’s important to determine which columns to put the index key.
Analyze which indexes are being used so we can drop ones that aren’t will save storage space.

1.4 Create & modify Constraints c3.2

Implement constraints to verify data integrity
Implement constraints to support the optimizer

1.5 Implement Data Types C3.1 & 8.1
Attribute that specifies the type of data.

1.6 Implement partitioning solutions c6.2

CODE examples in a test database named dbTomato

Let’s check out a script for creating a table such as the simple aspnet_users



Use dbTomato

CREATE TABLE [dbo].[aspnet_Users]
(
[ApplicationId] [uniqueidentifier] NOT NULL
, [UserId] [uniqueidentifier] NOT NULL
, [UserName] [nvarchar](256) NOT NULL
, [LoweredUserName] [nvarchar](256) NOT NULL
, [MobileAlias] [nvarchar](16) NULL
, [IsAnonymous] [bit] NOT NULL
, [LastActivityDate] [datetime] NOT NULL
)


Create two new data types Code example:

Create two new data types Code example:



01

Use dbTomato
02 CREATE TYPE dbName.NAME FROM NVARCHAR(60);
03
04 CREATE TYPE dbName.CURRENCYVALUE FROM DECIMAL(12,5);

Create View

create view v_aspnet_Users_anonymous
05
as
06
SELECT UserId, UserName, IsAnonymous
07
FROM dbo.aspnet_Users
08 WHERE (IsAnonymous = 1)
09 GO

Clustered indexes & non-clustered indexes differ.
10 ALTER TABLE dbTomato.aspnet_User
11 ADD CONSTRAINT PKUserID
12
PRIMARY KEY NONCLUSTERED (UserID);

Code to Modify existing table this example alters the aspnet_Users table by changing the datatype to navarchar(17) & allow not null:

ALTER TABLE aspnet_Users
13
ALTER COLUMN MobileAlias nvarchar(17) NOT NULL;
14 Constraints, a real constraint from the aspnet_Users table is below:
15 ALTER TABLE [dbo].[aspnet_Users] ADD DEFAULT (0) FOR [IsAnonymous]
16



---------------------------------------


GO

Question Concepts Examples

1.1 When we have a field that we want to be unique such as two rows not having the same value we can right click in the design view of the table on the column & add a key with the Is Unique property set to True.

1.2 Adding a foreign key constraint

1.3 Alter table to use less space

1.3.1 Changing the data type of the Volume column from bigint to int has the potential to truncate data, but the conversion is valid

1.3.2 Nothing in the table declaration prevents it from being compressed; therefore, REBUILD WITH (DATA_COMPRESSION = ROW) is a valid alteration.

1.4 Storing videos Microsoft SQL Server 2008 introduces the FILESTREAM storage attribute for binary data stored in a varbinary(max) column, which stores binary data on the local file system rather than in the database file. This optimizes read performance for large binary objects, which makes it the best option for the application being developed.

1.5 Minimize execution time --: Indexing the monthlySalary column of the view minimizes the execution time of the GROUP BY clause of the statement in question. To create an index on a view, it must also include a unique clustered index.

1.6 Prevent users from coping a view The WITH ENCRYPTION option of the CREATE VIEW command encrypts the view definition in sys.syscomments so that it cannot be viewed by anyone, even the view's owner

1.7 A row is deleted from a table w/ an identity column . to reinsert the data we : SET IDENTITY_INSERT Products ON; allows explicit values to be entered into an identity column for the remainder of the current session or until it is turned off again.

1.8 The correct syntax for creating this alias data type is CREATE TYPE salary FROM decimal (8). The data type should be based on the decimal type rather than the float type because the values included do not exceed 10 million and a decimal column with a precision of 8 uses less storage space than does a float column

1.9 Decrease time it takes statement to execute: CREATE INDEX expertise_index ON Contractors (expertise) WHERE lastUpdated > '20080101'; is the best choice because it limits the index to only the rows relevant to the statement in question, which minimizes both the size of the index and the time to search the index.

1.10 Grant persmissions The view grants users the access they need while denying them access to any other portions of the database. It also provides flexibility for the users to work with the data as they see fit.

1.11 Add column to same table on multiple servers we create a server group

1.12 Improve perf by partitioning table

1.13 Reduce storage: Setting FILLFACTOR to 70 leaves 30 percent of the space on each leaf-level page empty, allowing for future growth and reducing page splits.

1.14 Xml file data -- > create a table

1.15 Improve select speed Add the PERSISTED option to the Profitability column. The PERSISTED option increases performance when a calculated column is retrieved at the expense of performance when the column is inserted or altered. This is achieved by performing the calculation when the data is entered and storing the result in the database. When the Profitability column is not PERSISTED, the nested CASE statements must be parsed each time the column is queried. Because retrieving calculated data is faster than calculating both CASE statements, making the Profitability column PERSISTED results in the largest performance gain.

1.16 Insert row with view & where clause

1.17 Transfer data from partition

1.18 Altering table not success due to WITH SCHEMABINDING When a view is created with the WITH SCHEMABINDING option, none of the rows used in the view can be altered without dropping or altering the view first.

Next up the other objectives in the exam!

That is all there will be more,

As always all comments welcome,

Catto

Wednesday, May 5, 2010

SQL2008 Database Dev 70-433 Skills Measured Code Crackin #22

Hey Now Everybody,

SQL Server Database Development 70-433

Here we are I’m preparing for the SQL Database Dev exam & enjoying reviewing the material. Let’s inspect the skills measured for this exam & read the MSDN library on the topics. This is a good way to start preparing for this exam. Below are the skills measured for the exam along with links to mostly the MSDN library to read more information on each skill: 

Official Skills Measured
Implementing Tables and Views (14 percent)
Implementing Programming Objects (16 percent)
Working with Query Fundamentals (21 percent)
Applying Additional Query Techniques (15 percent)
Working with Additional SQL Server Components (11 percent)
Working with XML Data (12 percent)
Gathering Performance Information (11 percent)

70-433 7 Sections & Major Details only

clip_image004

1. Implementing Tables & Views (14 percent)
1.1 Create & Alter Tables 3.1
1.2 Create & Alter Views 5.4
1.3 Create & Alter Indexes 6.2
1.4 Create & modify Constraints 3.2
1.5 Implement Data Types C3.1 & 8.1
1.6 Implement partitioning solutions c6.2

2 Implementing Programming Objects (16 percent)
2.1 Create & Alter Stored Procedures
2.2 Create & Alter User-Defined Functions UDFs
2.3 Create & Alter DML Triggers
2.4 Create & Alter DDL Triggers
2.5 Create & Deploy CLR-Based Objects c7.2
2.6 Implement Error handling c5.1
2.7 Manage Transactions

3 Working with Query Fundamentals (21 percent)
3.`1 Query Data by using Select statements c1.2
3.2 Modify Data by using Insert, Update & Delete statements c2.1
3.3 Return data by using the OUTPUT clause c2.2
3.4 Modify data by using MERGE statement c2.2
3.5 Implement aggregate queries (LINQ) c1.3
3.6 Combine datasets c1.4
3.7 Apply built in scalar functions c1.5

4 Applying Additional Query Techniques (15 percent)
4.1 Implement Subqueries c4.2
4.2 Implement CTE Common Table Expression Queries c4.1
4.3 Apply Ranking Functions c4.3
4.4 Control Execution Plans c6.1
4.5 Manage International Considerations c3.1

5. Working with Additional SQL Server Components (11 percent)
5.1 Intergrate Database Mail c8.1
5.2 Implement Full Text Search c8.2
5.3 Implement Scripts using Powershell & SMOs c9.2
5.4 Implement Service Broker Solutions c8.3
5.5 Track Data Changes LINQ c 9.3

6 Working with XML Data (12 percent)
6.1 Retrieve Relational Data as XML c7.1
6.2 Transform XML data into relational data c7.1
6.3 Query XML data c7.1
6.4 Manage XML data c7.1

7 Gathering Performance Information (11 percent)
7.1 Capture Execution Plans c6.1
7.2 Gather trace info by using the SQL Server Profiler c6.1
7.3 Collect output from the Database Engine Tuning Advisor c6.2
7.4 Collect info from system.metadata c6.1, c6.2

Skills Details

Implementing Tables and Views (14 percent)

Implementing Programming Objects (16 percent)

Working with Query Fundamentals (21 percent)

Applying Additional Query Techniques (15 percent)

Working with Additional SQL Server Components (11 percent)

Working with XML Data (12 percent)

Gathering Performance Information (11 percent)

Whew that is quite a bit of skills measured, glad we went threw them.

As Always All comments welcome
That is all, there will be more.

Catto

Tuesday, May 4, 2010

MCPD 4 How to Study & Take Beta Exam for Free - Code Crackin #21

Hey Now Everybody,

Do you think Microsoft exams & certifications are a good use of time or a waste?

On Friday April 30th 2010 I took the MCPD 4 Web Dev 71-519 beta exam for free. First I heard about the beta exam by an RSS feed, then I called Prometric, registered for two exams the technical specialist & pro web dev exams. Then I had a date set & location for each exam. I prepared by reviewing the skills measured & content in the MSDN library. The previous exam for the .NET 3.5 framework is what I used as for a guide since there wasn’t much public content about the new exam.

Beta exams are really great since they are free & if you pass you get the cert. What I really enjoyed about the exams is by having a date with the exam scheduled I created a plan to study & it motivated me. It’s something to work for. I spent about 3 weeks preparing for each exam. Next week a local user group I enjoy is going to have a meeting on an exam review for another exam I’m interested in which is the SQL Server 2008 Developer exam 70-433. So now I’ve been preparing for that exam too. The content is good to study & will only help improve development skills.

Now again I ask you, Are MS Exams good to take? Is the content good to study? What do you think?

As Always all comments welcome,

That is all there will be more,

Catto

Wednesday, April 28, 2010

MCPD 4 Microsoft Beta Exam Prep ~80 Key Terms 70-519 Code Crackin #20

Hey Now Everybody,

As preparation continues for the new MCPD 4 exam 70-519 / 71-519 / 70-564, let us inspect some key terms. Each of these terms are linked to a good resource page most to the MSDN library. By reading all these term then skimming though the resource page can only help us prepare for the Microsoft Certified Professional Developer exam. This post is intended to help people prepare for the exam & learn .NET.

Here are ~80 key terms linked to a good reference:

APP_LOCALRESOURCES 
EVENTMAPPINGS/ALLAUDITS
TRACEBUMP;
ACTIVEDIRECTORYMEMBERSHIPPROVIDER;
AD  Auth;ADDFILEDEPENDENCY;
AD_IMPERSONATE;
ADVANCEDENCRYPTION;
APPLICATION.ERROR –;
ASPNET_COMPILER –;
ASPNET_MEMBERSHIP – ;
ASYNC=”TRUE”;
userprofileCulure;
CONFIGURE_SITEMAPDATASOURCE –;
CONTROLSTATE –;
COOKIELESS – ;
COOKIEPROTECTION – ;
CUSTOM_PROFILE_PROVIDER –;
CUSTOM_WEB_CONTROL –;
CUSTOMER_EXTENDER – ;
DAL;
DATAPager;
DELIMITEDLISTTRACELISTENER – ;
deploywebapp;
HTMLENCODE;
excel;
FormView;
GRIDVIEW – ;
HTTPHANDLER;
HTTPHANDLER/RSS -
HTTPMODULE;
IN-MEMORY – server;
JSDEBUGGING;
JSON;
LinkButton;
LINQ;
LINQDATASOURCE;
listview;
localiationz;
MASTERPAGEFILE;
MEDIAFILES;
MEMBERSHIP;
MULTIVIEW;
OBJECTDATASOURCE;
OLEDBDATATABLEADAPTER;
sitemapresolve;
XSS;
GRIDVIEW;
HTMLENCODE;
HTTPMODULE;
HTTPS server;
MOBLIE;
MULTIVIEW;
NESTEDMASTERS
OBJECTDATASOURCE;
OLEDBDATATABLEADAPTER;
PAGE.ISVALID;
PARSECONTORL()PREINIT
PROTECTEDDATA;
REQUIREDFIELDVALIDATOR
Page.RegisterAsyncTask
RSS;
SAVESTATECOMPLETE;
SECUREHASH;
sitemapresolve;
SITEMASPPATH;
skins;
SQLDATASOURCE;
SQL-INJECTION;
ssl;
stateserver;
THEMES/PREINIT;
TRACE_ELEMENT;
UPDATECOMMAND;
WEBCONTROLADAPTER;
WEBSERVICE;
webapps vs.website
XMLDataSource

So we just went thought quite a bit of content which will help us prepare for the exams. What do you think?

As always all comments welcome.

That is all, there will be more,

Catto

Thursday, April 22, 2010

MCPD .NET 4 Preparing for the Microsoft beta exam 70-519 - Code Crackin #19

Hey Now Everybody,

Preparing for the Microsoft MCPD .NET 4 beta exam 70-519. This is the next version of the 3.5 70-564 exam. The MCTS exams have the self paced training kit books which are stellar resources to study from, however the MCPD exams there isn’t as much exam prep materials. Outlined are the skills measured in this exam.

This is posted to help people & myself study for the exam & learn more about .NET 4. Below are some key points that I’ve summarized so we can just read basically one or two sentences which will cover one topic or concept. I’ve tried to present this content in a way to use our time most efficiently with not much repetition and content we we use.

70-564 / 70-519 / 71-519
Key Concepts:

331 AD Authentication mode & identity Impersonation such as <authentication mode="Windows" /><identity impersonate="true" />

332 Master pages & webconfig specifies master page for application

333. DataSources for example LinqDataSource, when data's being retrieved by a datacontext object

334. Prevent harmful scripts being stored in sql db we can ValidateRequest attribute of the @Page directive should be set to false & saving the text to the database, you should make use of the Server.HtmlEncode method

335. Verifying data inputted into db is valid by when the Page.IsValid property is True use the Click event handler of the
   Button control to submit the data

336  Store data for lifetime of app we can use In-memory of the Web server process should be used as the storage.

337. Web Apps -When pages are updated frequently & we want quick startup time we precompile the application along with the fixed assembly names by using the aspnet_compiler utility.

338. Ensure updating pages doesn't effect load time of other pages we use a Web site project copy the entire application to the deployment server and copy only the updated files to the server.

339. Multiple master pages with user controls to dynamically reference the control we:
    Code each master page class to implement a common interface exposing the ImageUrl property of the Image control
   create a strongly typed master page reference by using the @ MasterType directive on each content page

4110 Upgrading applications by upgrade the application to a Visual Studio 2010 Web application project

4111 AD auth - When an unauthenticated user hits a page we want to force them to enter uid & pw we use of Forms authentication.Use the ActiveDirectoryMembershipProvide class

4112 when a data bound control which we can page through records, create, update we can use a FormView

4113. When a page displays data from a db based on an id & not creating a new node in the sitemap for each page we can handle the SiteMap.SiteMapResolve event

4114. When we want to display data in a grid we retrieve data for the GridView control by using the SqlDataSource control

4115. When a control supports 2 languages such as all German-region views in German all others in english we can for each page without any culture specified & ge culture, create a resource file place the files in the App_LocalResources directory

4116. Consistent display properties of controls we define a skin for each type of ASP.NET server control that is used in the app

4117. A DAL supporting 3rd party vendors the data access object we use OleDbDataAdapter

4118. Deploying an app ensure assemblies comply w/ rules & naming conventions we create a Web app project, the output assembly name should be set to conform to the rules.

4119 Excel files in a folder that we don't want accessed from bots we have each the Excel files should be mapped to the ASP.NET ISAPI filter & a <deny> element should be added to the <authorization> element in the Web.config file

4120. When a firewall denies access on ports 80 & 443 we use the Secure Sockets Layer (SSL) on port 443 to expose the Web services.

8221. Databound server control that uses customized item templates & uses the DataPager we use a ListView.

8222. when subdirctories are permission based by roles & stored in a single web.config file we'd use the <location> node.

8223. Apply a theme to a page we'd use the handler for the Page.PreInit event

8224. When we store state of a shopping cart by UID the shopping cart should be stored in a user profile property.

8225. Display content in languages of users preference we use the value of the Page.UICulture property should be set to a value stored in a user profile property.

8226. Log all audit events for an app we configure the eventMappings node in the Machine.config file so that a single entry for auditing events is present for All Audits.

8227. Improve search relevancy of page URL by not having .aspx ext use an HttpModule object can be used to make sure of this.

8228 Use 3rd party db's & prevent update or delete the data tier object we choose to use OleDbDataReader

8229. Custom client side & AJAX behaviors to be added to server controls we can for each server control, a custom extender control has to be created. After add the extender controls along with the server controls in the Web forms.

8230. Validate against AD by client side script. code fragment should be added to the Web.config file of the application <authentication mode="Forms" />
configure the application, making it use the ActiveDirectoryMembershipProvider class.

8231. Implementing a master page we can:
  set the MasterPageFile property on each page to the virtual path of the master page file
& configure a virtual directory within each app, and point the virtual directory to the folder containing the master page
& copy the master page into a single folder on the server

8232 Modify & update data that is retrieved from a data set. using SQLCommandBuilder the update command for related SQLDataAdapter class we'd after the UpdateCommand property of the SqlDataAdapter class is set to a SqlCommand object, we use a custom UPDATE statement and call the Update method of the SqlDataAdapter class

8233. Performance issues occur & we collect sample timings of pages. We set the enabled attribute to true and the pageOutput attribute set to false for the Web.config's trace element
Trace Element - enabled attribute = true & pageOutput attribute = false

8234 Photo sharing app to download the image, first we ascertain the request for the photo download by creating an HttpHandler class, then process photo for format & return photo

8235.  DB accessed by web app, web & sql servers on separate servers we create a Web service, deploy it to the same network as the database server

8236 Application_error event: Create tracking number for errors after the exception is logged in the Application_Error event of the Global.asax file, we redirect to the customError.aspx page, pass tracking number in query string.

8237 Set up Authentication for a subdirectory add this code to the Web.config in the subdirectory.
<allow roles="TomatoSubscriber" />
<deny users="*" />

8238.Debug js by displaying fields of AJAX object in trace console in web form we choose to use Sys.Debug.traceDump

8239 Web form calls web service when page is accessed ensure two routines are called we have  Async="True" attribute has to be added to the Page directive.

3440.   Deploy app to server where there are more than one app is & the app is the only one that can modify certain files on the server,  After the application pool is configured to use a dedicated user account, we give access for the share to the user account.

3441. AddFileDependency When a batch process updates a xml file code segment: Response.AddFileDependency(fileDependencyPath);Response.Cache.SetCacheability(HttpCacheability.Public);

3442. Create a control in VS10 toolbox we'd use a custom server control

3443.  LINQ: var query =
from item in Items
where item.Books.All(b => b.Price <= 52)
select item;
All Items that have the price of the related magazine less than or equal to 52

3444.  Authorization info cashed: the cookieProtection attribute should be set to Encryption in the roleManager element of the Web.config

3445. Save ViewState info in SQL we'd use the SaveStateComplete event

3446. Create UI element we'd create a custom Web control.

3447. Store sensitive data that can be viewed in db, before we store sensitive data in the database, we'd use the Advanced Encryption Standard algorithm to encrypt the data.

3448. Site uses the SiteMapPath control connected to a sitemap & we need to configure a treeview.  After we configure a SiteMapDataSource control to use the XmlSiteMapProvider control, we configure the TreeView control to use the SiteMapDataSource control.

3449. Page that asks many questions & guides user though troubleshooting we'd choose to use MultiView control.

3450. Prevent bots from registering site:  Implement a Completely Automated Public Turing Tests (CAPTCHA) during the reg & login
& Send confirmation e-mail to new users. Disallow new user access until user responds to the e-mail message.

3451. No profile data stored in clear text we  First we create a custom profile provider. Before we store information in db, we ensure it's encrypted in the custom provider.

3452. Info able to be displayed in Excel we  use the DelimitedListTraceListener class.

3453.Users able to view updates on info from site  we supply a Really Simple Syndication (RSS) link adjacent to each product. And then we base the RSS feed on a Web service that returns updates for the product.

3454.  Authentication using existing db w/ table of UID & PW we'd  create a custom membership provider that has to be used.

3455. Users browsers specifies German we'd  rename the Default.aspx.es-ES.resx file to Default.aspx.es.resx.

3456. SQL SELECT Order.OrderID
,Order.Description
,OrderDetails.UnitPrice
FROM Order JOIN OrderDetails
ON Order.OrderID = OrderDetails.OrderID
LINQ from order in db.Ordersjoin details
in db.OrderDetails onorder.OrderID
equals details.OrderIDselect
new { order.OrderID, order.Description, details.UnitPrice};

9457. Web app renders in mobile devices Add a custom browser definition file to the application App_Browsers folder.
& Configure the application code to query the Capabilities property of the Request.Browser object

9458. DataPager control ensure it has properties exposed to webpardzone controls on all pages A zonelement element should be added to the WebPartZone control on each page.
& After the DataPagerControl control is copied into a new user control, we use the @Register directive to add a reference to the new user control in each page.

9259. Ensure web form w/ link button functions in browsers w/ js disabled the LinkButton control should be replaced with an HtmlInputSubmit control

9260. Databound ddl create an XML file in the App_Data directory to represent the data in the DropDownList control & bind the XmlDataSource control to the DataSource property of the DropDownList control.

9261. Set storage for session-state the session-state values stored in the StateServer state provider

9262. Dynamically added controls used for lifetime of page event after PostBack call the Page.ParseControl() method in the PreInit event of the page.

9263. Invoke web service asynchronously & execute tasks simultaneously we invoke the RegisterAsyncTask method.

9264. Reduce SQL injection:
 constrain & sanitize user input,
& use a least-privileged database account,
& use parameterized SQL statements.

9265. Dynamic Pricelist in master pages we After a custom master page is created for mobile-device browsers, modify the page that contains the price list to use device filters along with the MasterPageFile attribute of the @ Page directive.

9266. HTML stored in db & any scripts cannot be executed on browser use System.Web.HttpUtility.HtmlEncode() method

9267. Encrypt but not decrypt passwords we Encrypt passwords by using the Secure Hash algorithm before the passwords are stored in the db.

9268. Gridview using business object to select & update The DataSourceID property of the GridView control set to an ObjectDataSource instance that uses the business object.

9269. Calc time for all process requests we create and register a custom HttpModule class.

5970. Forms auth app & we make users access via AD we alter the membership provider to ActiveDirectoryMembershipProvider.

5971. Change RadioButtonLists to drop downs create a class that extends the WebControlAdapter class & register it in a browser file.

5972. Ensure VS10 automatically recognize new images added to project a Web site project we copy the files that are part of the application to the source folder of the application.

5973. Validate a user selects drop down selection that is not default selected we use RequiredFieldValidator .

5974. Control on each page at most 4 pages a SiteMapPath control added on each page, & the ParentLevelsDisplayed property set to 4

5975. App uses Forms auth & users can access sessions of other users we add to the Web.config <forms cookieless="UseCookies">

5976. Logging intermittent errors we create An event handler for the Application.Error event should be added to the Global.asax file of the app

5977. Consistent state management use ControlState

5978. Nested Masters After we create a nested master page that binds to existing master page, the reporting section-specific ContentPlaceHolder controls are added to the new master page. Then we configure content pages in the ~/Reporting folder, making it use the new master page

5979. Session State persistence we use the session-state values by using the SQLServer state provider

5980. Debug JS In IE enable script debugging

5981. Private key used to encrypt & decrypt we make use of the System.Security.ProtectedData class

5982. Data bound control built in sort we choose GridView

5983. Secure authentication cookie use a secure HTTP connection for any request that involves the transmission of an authentication cookie.

5984. ASP.NET AJAX app & a Web service returns data w/ compact format & minimum markup overhead we create a JSON Web service

5985. Implement data access for third party db's & prevents xss use parameterized SQL statements. .

5986. Web control provides data to other controls on page to third party db's use of an OleDbDataTableAdapter object.

5987. To Implement RSS we create & register a custom HttpHandler class that releases the RSS feeds & associate the HttpHandler class to the .rss extension.

5988. When page request is made provide page layouts & themes we have theme & master page have to be dynamically set in the PreInit event of each page.

Hope you enjoyed this content & the way it was presented.

That is all there will be more,

Catto

Wednesday, April 21, 2010

Visual studio 2010 Microsoft Event Launch Miami 4.20.10

Miami Visual studio 2010 Microsoft Event Launch

Hey Now Everybody,

 image

4.20.10 The Miami Visual studio 2010 Microsoft Event Launch. It was a fun event. I went with a two of my friends Code Monkeez & WeToddz which makes it even better. Aside from VS10 the highlight for me was seeing a the first Win7 phone in Florida.

When we got there we received a DVD of the Trial version of Visual Studio 2010 for 90 which is also available on Microsoft downloads, along with a T-Shirt & some stickers which was very nice.

We took a look at a sample web app named Blue Yonder Solutions was the demo ASP.NET application demo The two Microsoft presenters were Joe ‘DevFish’ Healy & Glenn Gordon.

Joe showed quite a few features of VS10 which he called his tackle box of vs10:

VS10 Multimonitor Support Rip Tab off
Natural Scolling
quick replace for block of code Alt+Shift+Arrow
VB Line Continuation chars are gone
Visual Studio Extentions
HTML Snippets on right click instert snippet
VB has generate method on right click of definition
Words highlighted, when one word is highlighted all the instances are highlighted
New help experience
VB Collection Initializers
C# Named & Optional Arguments
C++ Joe asked how many people using it & only 3 people raised hands
F# improvements
Office UI Customization
SharePoint Explorer (F5 run)
SharePoint 2010 Project Templates
SharePoint 2010 F5 Debugging Experience
InetlliTrace - Historical Debugging
UML / Data Diagrams
Automate UI Testing
VSTS Anywhere

We got into Silverlight a little with the Silverlight Facebook ux is better than web 1.0 sites. Silverlight is important & has started to lap WPF.
Silverlight 4 is slick since it has many rich features such as mic & webcam, multicast streaming, WCF RIA servers, Printing, Out of browser, right click/mouse wheel. There are some new controls for Silverlight to business-centric apps such as calendar, charts. Silverlight can be outof the browser, store data locally & use local resources.

When starting an empty web app there in the web config there are two config files for dev & prod for example web.debug.config web.release.config We then inspected some data access layers. We moved on to WPF where Joe built a WPF app on the fly which was pretty nice to see. He also displayed a parallel computing example by using both cpu cores. We took a break & then got back into the web development w/ vs2010. They stated web forms are far from dead & being enhanced such as dynamic data.

Glen Gordon presented a nice dynamic data web app example with a good amount of code. We spoke about MVC concepts such as how it separated concerns & is easily testable. Glen finished the session with some windows phone, he stated 3 screens and a cloud example workstation, phone & Xbox are 3 screens tied by the cloud.
Win7 phone has standardized hardware.

There was many people including some local user group leaders who announced a couple events such as Swamp Code Camp 9.25.10 (South West Fla ) Homnick's Gold Coast UG announced a meeting May 13th SQL Server 2008 Dev Exam 70-422.

For this event the room was full about There ~150 people. The live event was very enjoyable & glad I went.

That is all there will be more,
Catto