C#
UPDATE: take a look at http://json.codeplex.com/ before you try and roll your own, it supports dynamic now...
I recently had to get a JSON feed from the web and traverse it. Like any good developer I started off with a Bing search and stumbled across a few posts.
The first by Nikhil Kothari looked interesting but his implementation did way too much, all I needed to do was read a JSON file, did I really need all that code.
http://www.nikhilk.net/CSharp-Dynamic-Programming-JSON.aspx
The second post I saw by Alex Ghiondea again looked interesting but relied on a library from codeplex (JSON.NET, http://json.codeplex.com/) and again...
This Saturday (2/27) I will be giving my .NET Generics talk for the UT Dallas .NET UG in Richardson TX. If you are in the area please check it out (http://www.usergroupsupportservices.com/UGEventView.ugss?EventID=9160). If you cannot make it but are interested in seeing the talk, you can watch it online.
Abstract:
Generics let you tailor a method, class, structure, or interface to the precise data type it acts upon. In this session we will discuss what capabilities Generics provide to you the developer and how to use them in collections, and with delegates. We will also talk about creating your own generic classes and...
Thanks to all that attended my 3 talks at the Dallas Dev Cares UG yesterday and thanks Ken Byrd from TekFocus for hosting the meeting. As promised here is the download of the PowerPoint and code bits. I also included links to recordings of 2 of the 3 talks.
Download Presentations Here
Recording of ASP.NET Dynamic Data:
Recording of Developer of <T> Generics talk:
By popular request on Dec 11 I will be giving 2 of my most popular talks on C# Generics and ASP.NET Dynamic Data. Then as a bonus just for the DevCares Community I will put together some of my favorite VS.NET Tips and Tricks. You can attend online or in person. Get all the details on there website at http://www.dallasdevcares.com/
Thanks to everyone that attended my .NET Generics Talk at the Tulsa Tech Fest today. You can download the code and PowerPoint here, and the recording will be posted to this blog and INETA Live shortly.
Developer<T>: Utilizing .NET Generics to write better code
Shawn Weisfeld
Generics let you tailor a method, class, structure, or interface to the precise data type it acts upon. In this session we will discuss what capabilities Generics provide to you the developer and how to use them in collections, and with delegates. We will also talk about creating your own generic classes and methods....
Multiple-Rowset allows you to return more than one select from your stored procedure. For example in the stored procedure below you can see we have 2 select statements. As we learned in my last 2 posts it is possible to use LINQ to SQL without the designer. A simple select with LINQ to SQL and without the designer (http://drowningintechnicaldebt.com/blogs/shawnweisfeld/archive/2009/07/11/a-simple-select-with-linq-to-sql-and-without-the-designer.aspx) Call a stored procedure with LINQ to SQL and without the designer (http://drowningintechnicaldebt.com/blogs/shawnweisfeld/archive/2009/07/11/call-a-stored-procedure-with-linq-to-sql-and-without-the-designer.aspx) To utilize Multiple-Rowset we just need to tweak our function in our data context...
In my last post I talked about how to do a simple select with LINQ to SQL without the designer (http://drowningintechnicaldebt.com/blogs/shawnweisfeld/archive/2009/07/11/a-simple-select-with-linq-to-sql-and-without-the-designer.aspx). This is all well and good, but what if you need to use a stored procedure. Like this one. . . .
The first step is to add to our data context a method that maps to our stored procedure. You can see we start off with a Function attribute that tells LINQ to SQL what stored procedure to use. Additionally we decorate the parameters on our method with Parameter attributes that tell LINQ to SQL how to...
Many folks poo-poo LINQ to SQL because they don’t like designers. On the other hand some developers, myself included, like knowing how things work behind the scenes, for those edge case moments when the designer cannot do something. The most common business case for this is if you want to LINQ to SQL-afy an existing suite of objects. Well using the designers is NOT a requirement of LINQ to SQL. Lets say for example you had an existing customer table and customer business object: Lets see if we can get LINQ to SQL to...
I wrote this for an INETA project that I have been working on, but thought it would be great to share with everyone. We had a need to take an image and change its size. Below is an implementation of a Resize Extension Method on the .NET Image object.
I borrowed some ideas from this post by Mark McDonnell (http://weblogs.asp.net/markmcdonnell/archive/2008/03/09/resize-image-before-uploading-to-server.aspx)
1: using System;
2: using System.Collections.Generic;
3: using System.Linq;
4: using System.Text;
5: using System.Drawing;
6: using System.Drawing.Drawing2D;
7: ...
Got a call today, someone was getting a stack dump every time they tried to assign a value to a property. Here is a screen print of the problem they were having. can you spot the problem? If you said that the property is calling itself you get a gold star. What was happening is that every time we tried to set the Name property, it calls the Name property to set it, and that called the Name property, and that called the Name property, over and over again, till .NET stack dumped. We are missing a...
Full C# Archive