Cookies

May 5, 2010 00:50 by mstark
Writing Cookies

The browser is responsible for managing cookies on a user system. Cookies are sent to the browser via the HttpResponse object that exposes a collection called Cookies. You can access the HttpResponse object as the Response property of your Page class. Any cookies that you want to send to the browser must be added to this collection. When creating a cookie, you specify a Name and Value. Each cookie must have a unique name so that it can be identified later when reading it from the browser. Because cookies are stored by name, naming two cookies the same will cause one to be overwritten.

You can also set a cookie's date and time expiration. Expired cookies are deleted by the browser when a user visits the site that wrote the cookies. The expiration of a cookie should be set for as long as your application considers the cookie value to be valid. For a cookie to effectively never expire, you can set the expiration date to be 50 years from now.

If you do not set the cookie's expiration, the cookie is created but it is not stored on the user's hard disk. Instead, the cookie is maintained as part of the user's session information. When the user closes the browser, the cookie is discarded. A non-persistent cookie like this is useful for information that needs to be stored for only a short time or that for security reasons should not be written to disk on the client computer. For example, non-persistent cookies are useful if the user is working on a public computer, where you do not want to write the cookie to disk.

You can add cookies to the Cookies collection in a number of ways. The following example shows two methods to write cookies:

Response.Cookies("userName").Value = "patrick"
Response.Cookies("userName").Expires = DateTime.Now.AddDays(1) Dim aCookie As New HttpCookie("lastVisit") aCookie.Value = DateTime.Now.ToString() aCookie.Expires = DateTime.Now.AddDays(1) Response.Cookies.Add(aCookie)

MSDN


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Session Timeout and AJAX

March 12, 2010 02:39 by mstark

Sessions are a way of preserving information on a web site between page hits, allowing the programmer to emulate a stateful application when, in fact, web pages are not really stateful.  They are also one of the banes of web development, since sessions eventually timeout when there is no interaction between the user and the web app for a prolonged period of time.  In ASP.NET, this period has a default of 20 minutes, which is really hardly enough time to pick up a donut, refill one's coffee, and chat with fellow workers before returning to one's computer.  What this often means is that the user, upon returning to their computer and continuing work after a 20 minute break will find that all of the data entry they have been doing has been lost.  Worse, strange errors will begin to appear in his web browser if the loss of a session is not handled gracefully.

image

AJAX Patterns Time Out

Imaginative Universe Session Expired article


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

SQL Saturday – Spatial Data

January 23, 2010 09:57 by mstark

Bing MapsThank you all for attending my session here are the files to download and get stated with spatial data with SQL Server 2008 and Virtual Earth.

 

Everything (PPT,ASP.NET,Database)

Just the ASP.Net code

Just database backup

Just the script to build the database

Just the PowerPointimage

Bing Maps AJAX SDK

Bing Maps Silverlight SDK


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

SQL Saturday – Zero to Cube

January 23, 2010 09:36 by mstark

Aggregated data according to your business needs.  It is optimized for business terms.  For example, Rolling numbers by quarter.

 

Zero to Cube in 60 Minutes

Overcome the barriers of traditional training and seminars with this Quick Start to building a cube. This all demo session will get you started and answer many questions you have about building cubes the right way, the first time.

Adam Jorgensen(website), President – Pragmatic Works Consulting - has over a decade of experience leading organizations around the world in developing and implementing enterprise solutions. Adam is also very involved in the community as a featured author on SQLServerCentral, SQLShare, as well as a regular contributor to the SQLPASS Virtual User Groups and other organizations. He regularly speaks at industry group events, Code Camps, and SQLSaturday events on strategic and technical topics.

image

Fact Tables – Actual facts such as sales, orders, or donations.

Dimension – any that starts with the word “by”.  For example, Sales by state or orders by gender.

 

 

 

Power Pivot (Website)

image


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

PowerShell ETL by Chad Miller

January 23, 2010 04:43 by mstark

In this session we will look at performing common data loading tasks with Powershell. A basic understanding of PowerShell is helpful, but not necessary. Specific topics covered include importing structured files, XML, WMI objects and ADO.NET data sources.

image Chad Miller(website) is a SQL Server DBA and Manager of Database Administration at Raymond James Financial. He has 10 years experience as DBA, working with SQL Server 6.5 through SQL Server 2008. In his spare time Chad is the Project Coordinator/Developer of Codeplex projects SQL Server PowerShell Extensions (SQLPSX) and PoshRSS.

Tampa PowerShell user group www.tampapowershell.com/

Joe Healy’s TweetPhoto HERE


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

SQL Saturday Tampa Sessions

January 23, 2010 04:36 by mstark

Troy Gallant (greatfuldba on Twitter) his website on Twitter

Troy offered a good overview of Transactional Replication in SQL Server. 

Microsoft uses a Magazine Publisher metaphor for labeling the various pieces. 

SQL Server replication allows DBAs to distribute data to various servers throughout an organization. Some of the primary reasons to employ replication include load balancing, offline processing & redundancy. Transactional replication in particular can offer a very flexible solution where data frequently changes. This session will discuss the basics of planning and implementation of a solid transactional replication solution.

Troy has been a SQL Server professional for over 6 years The first four were in the role of a developer, and the last two as DBA for an international organization of over 900 employees. When not working, Troy enjoys MMO's, the Grateful Dead, and whiling away the hours picking his mandolin.

-----

PowerShell

Functions can be used from various areas and used in unexpected areas.

In this session we will learn to perform several everyday DBA tasks like backing up user databases, scripting table objects and evaluating disk space usage with PowerShell. For each task we will explore the benefits of using PowerShell over the standard method. Only a basic understanding of PowerShell or DOS is needed. This session should serve as a good introduction to PowerShell for database users. The goal is to get data professionals feet wet using PowerShell.

Aaron Nelson(website) is a Senior SQL Server Architect, Database Developer, DBA, and Business Intelligence Developer with over 10 years experience in the architecture, design, development and maintenance of SQL Server. He is experienced managing enterprise-wide data needs in both transactional and data warehouse environments.


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

See you at SQL Saturday in Tampa!

January 19, 2010 13:08 by mstark

See you at the SQL Saturday event in Tampa.

Here is a map to the K Force building

K Force

SQLSaturday is a training event for SQL Server professionals and those wanting to learn about SQL Server.

This event will be held January 23rd, 2010 at K-Force, 1001 East Palm Avenue, Tampa, FL 33605.  K-Force has really stepped up.  After seeing the issues with the "box wall" and the "bowling alley", they have secured additional rooms at a venue next door.  The Tampa Code Camp recently took advantage of the expanded facilities and I am hearing great things as a result.

Admittance to this event is free, all costs are covered by donations and sponsorships. Please register soon as seating is limited, and let friends and colleagues know about the event.

Registration will open at 8:00 am.  The first session will start at 9:00 am and the last session will conclude at 5:00 pm.  At 5:15 the raffles will start and we should be out of there by 6:00 pm.


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Life Cam

January 12, 2010 06:47 by mstark

Microsoft LifeCam Cinema™

If you are in the market for a web cam that can serve the purpose of casual event recording, try the Microsoft Life Cam Cinema.  I plug it into my laptop and bring my laptop to the event.

Then I record the event using the software that come with the product.

It’s a webcam so it is optimized to capture voices near the camera.  Therefore, the people near the camera must be quiet. 

I used it to record an orchestra concert.  I was in the back row to get a wider camera angle but that is where all the people who prefer to talk and make noise sit so the microphone kept adjusting volume for their voices over the performers voices and instruments.

I used it for a later performance and sat on the front row and had much better results from the camera and the microphone.


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tampa Code Camp 2009

November 7, 2009 07:52 by mstark

As promised here are the slides from the presentation.

PowerPoint Slides

PDF version on the slides

eday


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

SQL Saturday #21 Orlando – Spatial Data in SQL 2008

October 19, 2009 03:54 by mstark

October 17, 2009

This session is

a quick tour of the spatial features of SQL Server 2008slide1

PowerPoint slides 

PowerPoint as PDF


Tyler Chessman's article in SQL Server Magazine's December 2008 issue is my primary source of information to implement my spatial solutions. Visit http://www.sqlmag.com and search for instant doc ID 100528.
Here is a link to the article

What is Spatial Data

  • Spatial data represents the shape and physical location of an object.
  • The object can be a house, business, sub-division, or a county.
  • SQL Server 2008 has two new data types GEOMETRY and GEOGRAPHY.
  • GEOMETRY works with flat objects.
  • GEOGRAPHY considers the shape of the earth.

CLR Types

  • GEOGRAPHY and GEOMETRY are CLR data types.
  • You do not need to have CLR enabled on the SQL Server instance.
  • Microsoft has provided a long list of OGC methods.
  • These are methods that are part of the independent Open Geospatial Consortium list of specifications

STDistance Function explained

  • The STDistance function requires an argument of the SQLgeometrytype
  • Convert the latitude and longitude to SQLgeometrytype.
  • Declare a variable of the geography type.
  • Set the variable to geography::STGeomFromText('point(lon lat)',4326).
  • Notice that the point is a string.
  • Notice there is no comma between lat and lon
  • 4326 is an SRID and is used to tell the function what method to use to calculate distance on a not-so-round planet.

STDistance in action

Declare @CodeGEOG geography =
geography::STGeomFromText('Point(-95.3410 29.7070)',4326);
Select top(5) addr.AddressID as id ,
addr.addressline1,addr.city,
addr.SpatialLocation, -- Will show the raw data
addr.SpatialLocation.AsGml() as SpationalGML,
addr.SpatialLocation.STAsText() as SpatialText,
addr.SpatialLocation.STGeometryType() as GeoType,
addr.SpatialLocation.STNumPoints() as Points,
addr.SpatialLocation.STDistance(@CodeGEOG) as distance_in_meters,
addr.SpatialLocation.STDistance(@CodeGEOG)/1609.344 as distance_in_miles
from dbo.Address addr
Where
addr.SpatialLocation.STDistance(@CodeGEOG)/1609.344 < 50
order by distance_in_miles

Wire the SQL up to Virtual Earth

The wire will get it’s own blog entry


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5