pitan.net

.Net development
My Feed
Funny maj 28, 2008 13:00

Found this http://xkcd.com/327/ Damn now I know what to name my children. >< 



Tags: ,
Categories: Public | T-SQL
Actions: E-mail | Kick it! | Permalink | commentKommentarer (0) | RSS comment feedComment RSS
SQL Merge Part 1 maj 22, 2008 09:46

 T-SQL Merge and Strongly Typed DataSets

Merge is a great new function in sql 2008 (other databases have had it for a while I know)

I'm currently working in a project where I mixed it with a strongly typed dataset. It saved me allot of time when it came to updating/inserting tabels

First off the MERGE command

The tabel Identification handel som user information about there Identification. (Face2Face)

 First off i create a row with the incoming information.

[code=sql] 

USING (
  SELECT 
  @Label as Label ,
  @Info as Info,
  @Creator as Creator,
  @CreateDate as CreateDate,
  @PartyID as PartyID
  ) AS src

Then the magic. 

ON (Identification.PartyID = [src].PartyID) 

This will check with the destionation table if there is a row there that matches

if so Update else Insert 

 The whol thing... 

MERGE Table 
USING (
  SELECT 
  @Label as Label ,
  @Info as Info,
  @Creator as Creator,
  @CreateDate as CreateDate,
  @PartyID as PartyID
  ) AS src
 ON (Identification.PartyID = [src].PartyID)
 WHEN MATCHED THEN

UPDATE SET 
   
 Label = @Label ,
 Info = @Info ,
 CreateDate =@CreateDate ,
 PartyID = @PartyID 
   
 
 WHEN NOT MATCHED THEN
 INSERT ([Label]
  ,[Info]
  ,[Creator]
  ,[CreateDate]
  ,[PartyID])
  VALUES
  (@Label
  ,@Info
  ,@Creator
  ,@CreateDate
  ,@PartyID)

;


 

This is run inte a stored procedure called IndentificationSave

 

So there you have a Save command

Next part Strongly typed DataSet

 

 



Tags: ,
Categories: T-SQL
Actions: E-mail | Kick it! | Permalink | commentKommentarer (0) | RSS comment feedComment RSS
Development Feeds
Ben was cursing at a bug in some canvas code that he was playing with, where the rendering was off. One piece of his UI was blurred instead of crisp. The debugging exersize was fun, and he shares it with you on his personal blog. The moral of the story is: watch out for that zoom feature [...]
My teammate Stephen Walther launched the ASP.NET MVC Design Gallery a few weeks back. This stemmed from an idea ScottGu had to let the community change the default templates that ship with ASP.NET MVC . I was supposed to work on this but headed to Africa for the holidays so Stephen helped me out and took over the project and did a better job than I would have! You can vote on the designs that you like and that you don't like. You also can contribute new designs of your own. After you download a design from the gallery, you can use the design by following these steps: 1) Copy the files from DesignTemplateCS or DesignTemplateVB folder into your project (use DesignTemplateCS for C# projects and DesignTemplateVB for VB.NET projects) 2) Do a...(read more)
The Wiki continues to grow with updated Wiki Articles on Visual Studio, Silverlight, Mobile Applications, ASP.NET MVC Framework, and more. Share your knowledge and earn Community Recognition points by contributing to the ASP.NET Wiki.
In this video Chris Pels shows how to use the FtpWebRequest class to create an FTP connection and transfer a file. First, create a simple .aspx form to select a file to transfer to the FTP server. Next, see the essential methods and properties of the FtpWebRequest class that need to be configured in order to establish an FTP connection. Then, see how to get the local file contents so the file can be transferred using a StreamReader and a StreamWriter to write it to the FtpWebRequest. Finally, a FtpWebResponse is obtained to determine the outcome of the transfer. This approach can be used to programmatically transfer files for a web application.
Widgets

About the site

Hi,
So you found this site. Great hope you find somehting you like. This is more of a test site and ref. Not large post no personal stuff.  

The Development feeds
These are note mine post but rather some from diffrent sites so I can have a quick view of whats cooking out there. I'l add some more and some local buffing in the future.

The feeds are:
codeplex, asp.net, msdn, ajaxian. 

RecentPosts