Shawn Weisfeld

I find when I talk to myself nobody listens. - Shawn Weisfeld
posts - 365, comments - 180, trackbacks - 34

My Links


Shawn Weisfeld's Facebook profile

The views expressed in this blog are mine and mine alone, not that of my employer, Microsoft, or anyone else’s. No warrantee is given for the quality of any material on this site.


Post Categories

December 2007 Entries

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             //get the config info from the app.config file     2             ConnectionStringSettings myConnectionSettings = ConfigurationManager.ConnectionStrings["ConnectionKey"];     3             DbProviderFactory myProvider = DbProviderFactories.GetFactory(myConnectionSettings.ProviderName);     4      5             using (DbConnection myConnection = myProvider.CreateConnection())     6             using (DbCommand myCommand = myProvider.CreateCommand())     7             {     8                 // Get the connection string from the connectionsettings     9                 //...

posted @ Tuesday, December 18, 2007 8:44 PM | Feedback (0) | Filed Under [ .NET C# ]

2007 Day of Silverlight

Our original plan for Day of Silverlight was to have Jesse Liberty from the Silverlight product team come down and fill us in on all things Silverlight. After lunch sponsored by KFoce ( We planed to close the day out with a presentation by John Papa on WPF. Well the gods must not have been smiling on us because on the Tuesday before the event I got a frantic email from Bill Reiss ( telling me to read Jesse's blog ( After a few emails with Jesse I learned that he would have to cancel due to the fact that...

posted @ Sunday, December 16, 2007 3:55 PM | Feedback (0) |

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 no you cannot and after five minutes of back and forth I decided to throw together this example. Step 1: Build the codeHere you have 2 options: code as strings, code from CodeDom. What one you pick depends on what you are doing. In “Programming Microsoft ASP.NET 2.0 Applications Advanced Topics by...

posted @ Wednesday, December 12, 2007 3:17 PM | Feedback (0) | Filed Under [ .NET C# ]

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:       at System.Net.HttpWebRequest.GetRequestStream()       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) After some research I stumbled across this post by Rick Strahl but my problem was a little bit different. In his case he desired to disable to the automatic proxy detection, but I needed to wire in the script that my corperate IT department requires that we use. Easy enough just add the following to the web.config  <>  <defaultProxy>   <proxy scriptLocation ="url to script here" />  </defaultProxy> </> I...

posted @ Monday, December 3, 2007 10:28 PM | Feedback (0) | Filed Under [ ASP.NET C# SOA ]

Powered by: