Browse by Tags

All Tags » C# (RSS)

Generics , Extension Methods, and XML Serialization

At the Jax SQL Saturday I was asked to turn a .NET object into an xml file and then reverse the process. Step 1: Serialization with extension methods C# 3.0 comes with this cool feature called extension methods. This is syntactical sugar for static methods...
Posted by sweisfeld | 3 comment(s)
Filed under: ,

C# 3.0 (.NET 3.5) Language Features & Delegates

Two more questions from the floor at TechEd. Perhaps the most frequent question at TechEd is “What are the new features of C# 3.0?” Here is the short list: • Implicitly typed local variables • Extension methods • Lambda expressions • Object and collection...
Posted by sweisfeld | with no comments
Filed under: ,

Building a solution with many projects is SLOWWWWWWW

This week I am attending TechEd in Orlando FL and I was honored to be requested to work the C# booth by the MVP and C# teams. I got many great questions from attendees and I thought I would post some of the more interesting ones. So here goes. An attendee...
Posted by sweisfeld | with no comments

Chage the colors on a button

Got a question from an attendee at the Orlando Launch Event, he wanted to know how to change the colors of a button from code (i.e. the click event). Both of these items are properties on the button and can be changed easily with the following code. button1...
Posted by sweisfeld | with no comments
Filed under: ,

DateTimePicker control and its DateTimeKind setting

I got this information from one of my ONETUG members (thanks JT) and I thought I would share. There's a "feature" in the .NET 2.0 framework for the DateTimePicker control. When you assign it a value for the DateTime, it will inherit the...
Posted by sweisfeld | with no comments
Filed under: ,

2008 SQL Saturday Tampa

SQL Saturday Tampa 2008 was great, a big thank you to the organizers Pam, Wes, and team, great job guys! To those that attended my session on the SQL CLR I have uploaded my presentation here ( http://cid-afc22ba66ea68f7d.skydrive.live.com/self.aspx/Public...
Posted by sweisfeld | with no comments
Filed under: , ,

C# Tutorials

I was asked to provide some links to online C# Tutorials. I threw the list below together in 5 min, I know I have missed some great sites so please augment my list by leaving a comment. http://msdn2.microsoft.com/en-us/vcsharp/default.aspx http://windowsclient...
Posted by sweisfeld | 1 comment(s)
Filed under: ,

South Florida Code Camp 2008

The South Florida Code Camp was another great event. Many thanks go out to the team that worked the countless hours to put it together. For any of you that attended my talk on .NET Reflection here is my Code & PowerPoint. http://cid-afc22ba66ea68f7d...
Posted by sweisfeld | 1 comment(s)
Filed under: ,

.NET SecureStrings

After the last ONETUG meeting a member came up to me and told me that SecureStrings did not work in .NET. As always I take this as a challenge, and sure enough the proof is in the code. 1 //Sample borrowed from http://blogs.msdn.com/shawnfa/archive/2004...
Posted by sweisfeld | with no comments
Filed under:

Reflect on dll from the disk

Got a question after my reflection talk I gave to the User Group last week. The attendee wanted to load a dll from the disk and reflect on it. The assembly class has a LoadFile method that makes this easy as pie. Here is a code sample. //Read the dll...
Posted by sweisfeld | with no comments
Filed under:

Using the CCR for web service calls

So I figured I would see how the CCR compared the traditional .NET 2.0 Web Service model so I threw together this demo application. The interesting thing is that while I wired up the async call back events first, most of the CCR results arrived first...
Posted by sweisfeld | with no comments
Filed under:

Using the CCR for Line of Business Applications

For fun I have been playing around with Microsoft Robotics studio ( http://microsoft.com/robotics ) for a long time now and I have listened to Microsoft’s George Chrysanthakopoulos tell us how cool the CCR was in just about every webcast. Well I have...
Posted by sweisfeld | with no comments
Filed under: , ,

Execute a Stored Procedure: Quick and Dirty

Ok, I usually try to only talk about best practices but sometimes we all need a quick an dirty few lines to execute a stored procedure, no Enterprise Data Access, no LINQ, just System.Data and the managed provider for our given DB. Well here goes. 1 ...
Posted by sweisfeld | 1 comment(s)
Filed under: ,

Generate, Compile and Execute Code Dynamically

Like any good developer, when someone comes to my desk and says you cannot do something I have to prove them wrong. This was one of those challenges. He said you cannot “generate, compile and execute code on the fly in .NET”. I said yes you can, he said...
Posted by sweisfeld | with no comments
Filed under: ,

Unable to connect to the remote server

When attempting to call a webservice that lives outside my corperate firewall I was getting the following error: System.Net.WebException was unhandled by user code Message="Unable to connect to the remote server" Source="System" StackTrace...
Posted by sweisfeld | with no comments
Filed under: , ,
More Posts Next page »