If you want to retrieve one field from a table, you can use the ExecuteScalar method. This method executes a sql statement or stored procedure and returns a single value. Be sure to import the namespace: System.Data.SqlClient In C#: decimal amt; // Open the connection using (SqlConnection cnn = new SqlConnection(@"Data Source=.\SQLExpress;Initial Catalog=AcmeRentals;Integrated Security=True")) { […]
Silicon Valley Code Camp 2010
The Silicon Valley Code Camp is coming up again on October 9th and 10th. There are over 190 sessions and over 1500 people registered so far for this FREE code camp. Topics cover: .NET Silverlight Visual Studio LightSwitch Agile development technologies Cloud computing HTML 5 SharePoint Web Services Windows Phone 7 My talks are on […]
WinForms Checklist
There are endless numbers of details you have to contend with when building great software. So it is easy to forget about some of the small ones, especially when it comes to the UI. So I use a checklist like this one to help ensure I covered all of my bases. Form Related controls are […]
Keep Track of your Tasks With the Task List
Software development is more than just programming. We need to figure out what we are going to code, how we are going to code it, share information with our team, and track our progress. One tool that can help us with these tasks is the Task List within Visual Studio. The Task List is available […]
XML Literals: Creating XML with a Variable Namespace
This post covers the technique for creating XML that includes an XML namespace (xmlns) attribute, when that attribute is not predefined at compile time. This post continues the series on using XML literals which starts here. If you need to create XML with a namespace that is predefined at compile time, you can use the […]
XML Literals: Creating XML with a Namespace
This post covers the technique for creating XML that includes an XML namespace (xmlns) attribute. From Wikipedia: XML namespaces are used for providing uniquely named elements and attributes in an XML document. This post continues the series on using XML literals which starts here. Since XML Literals are a VB.NET feature only (new in VB […]
XML Literals: Creating XML
This post covers the technique for creating XML using XML literals. This post continues the series on using XML literals which starts here. Since XML literals are a VB.NET feature only (new in VB 9/VS 2008), this post only includes VB.NET code. The scenario is that we need to build an XML document, maybe to […]
XML Literals: Reading an XML File with a Variable Namespace
This post covers the technique for reading an XML file that includes an XML namespace (xmlns) attribute, when that attribute is not predefined at compile time. This post continues the series on using XML literals which starts here. If you need to read an XML file with a namespace that is predefined at compile time, […]
XML Literals: Reading an XML File with a Namespace
This post covers the technique for reading an XML file that includes an XML namespace (xmlns) attribute. From Wikipedia: XML namespaces are used for providing uniquely named elements and attributes in an XML document. This post continues the series on using XML literals which starts here. Since XML Literals are a VB.NET feature only (new […]
XML Literals: Reading an XML File II
This series of posts covers more information on using XML literals. Since XML Literals are a VB.NET feature only (new in VB 9/VS 2008), these posts will only include VB.NET code. The scenario is that we were given an XML file, maybe from a Web service or from an external application. The code needs to […]