Tag | VB.NET Posts

Recently I had an issue where I just could not set a drop down list’s selected value from the code behind. I set other drop down list’s selected values from the code behind with no problem. Just this one was giving me grief. So here is how I set the values normally (the drop down lists are inside a formview): VB.Net Dim ddl As DropDownList ddl = fvTest.FindControl("ddlWorks") ddl.SelectedValue = 5 C# DropDownList ddl; ddl = (DropDownList)fvTest.FindCo... int j = 5; ddl.SelectedValue ...
The title of this blog post is a lie. I don't actually love MFC C++, in fact I think it's safe to say I hate it. Hate may actually not be a strong enough word... but it's the best I can do at the moment. Recently, I had the pleasure of having to come up with a printing solution for Windows Mobile 6.5 devices. For those of you not in the know (which until recently included yours truly) there's no printing capability in Mobile IE 6. As in... NONE. There's no print option hiding on a menu somewhere, ...
Here is another way to access master page controls. This way has a bit less coding then my previous post on the subject. The scenario would be that you have a master page with a few navigation buttons at the top for users to navigate the app. After a button is clicked the corresponding aspx page would load in the ContentPlaceHolder. To make it easier for the users to see what page they are on I wanted the clicked navigation button to change color. This would be a quick visual for the user and is ...
Version 5.1.3 of Resharper has been released by Jetbrains. Download is at http://www.jetbrains.com/re... The release notes are at http://blogs.jetbrains.com/... Whilst 5.1.3 addresses just a specific issue, if you are programming in C# or VB.NET and if you have never tried Resharper before, you should try it. When I first saw ReSharper in use, within a few minutes I knew that it was worthwhile buying my own copy. Since then I have used ...
SubMain have announced at http://community.submain.co... that the next version of GhostDoc will include a VS2005/VS2008/VS2010 compatible spell checker. This replaces their existing spellchecker (http://submain.com/product... which is being discontinued. If you buy GhostDoc Pro now (I urge you to as it helps tremendously in documenting both C# and VB.NET code) , be sure to include Licence Protection as it means you will get the next version that includes ...
Build means compile and link only the source files that have changed since the last build, while Rebuild means compile and link all source files regardless of whether they changed or not. Build is the normal thing to do and is faster. Sometimes the versions of project target components can get out of sync and rebuild is necessary to make the build successful. In practice, you never need to Clean. Build or Rebuild Solution builds or rebuilds all projects in the your solution, while Build or Rebuild ...
All-In-One Interop and Fusion Code Samples Introduction Download Interop and Fusion code samples Request Interop and Fusion code samples Introduction The All-In-One Interop and Fusion code samples demonstrate the typical programming topics about .NET - native interop, COM interop, fusion, .NET Reflection, etc. These topics are either frequently asked in MSDN forums and Microsoft Support, or are requested by many developers via our code sample request function. We want to alleviate the frustration ...
All-In-One Office Development Code Samples Introduction Download Office development code samples Request Office development code samples Introduction The All-In-One Office development code samples demonstrate the typical programming topics about Microsoft Office. These topics are either frequently asked in MSDN forums and Microsoft Support, or are requested by many developers via our code sample request function. We want to alleviate the frustration felt by developers when they are developing Office ...
All-In-One Data Platform Code Samples Introduction Download Data Platform code samples Request Data Platform code samples Introduction The All-In-One Data Platform code samples demonstrate the typical programming topics about ADO.NET, Entity Framework, WCF Data Services, ADO, and other Data Platform technologies. These topics are either frequently asked in MSDN forums and Microsoft Support, or are requested by many developers via our code sample request function. We want to alleviate the frustration ...

This is a book that all J*** developers should read from cover to cover. I look forward to C# and VB.NET versions. There is a tendency in software development to go to extremes. This book helps to correct that tendency. I reccomend it also to all system architects.

ASP.Net Web Pages Helpers are re-usable components made of both HTML markup mixed with C# or VB.Net code. Helpers are designated using a special Razor Syntax tag @helper which routes the content within the tag to the appropriate Razor parser. (A brief introduction to the Razor syntax can be found here) I had the privilege of demonstrating a few out-of-the-box Web Pages Helpers using WebMatrix at the SoFla Local PDC10 a little over a week ago. Audience feedback was positive and Helpers' lightweight ...
Microsoft All-In-One Code Framework Microsoft SDKs MSDN Code Gallery Microsoft All-In-One Code Framework The Microsoft All-In-One Code Framework is a free, centralized code sample library provided by the Microsoft Community team. Their goal is to provide typical code samples for all Microsoft development technologies. The team listens to developers’ pains in MSDN forums, social media and various developer communities. They write code samples based on developers’ frequently asked programming tasks, ...
In this blog post, we will take a quick look at the new MVC 3 project options as well as the pretty sharp Razor View Engine (not suitable for shaving :) ). Based on a nice Stackoverflow post, it seems that MVC 3/Razor will only be supported in Visual Studio 2010/.Net 4.0. This is great as it will give developers yet another good selling point to argue for upgrading to .Net 4.0. Creating a new ASP.Net MVC 3 project Prior to ASP.Net MVC 3 Beta, Selecting “New Project” in VS 2010 yielded two templates ...
Here is a simple way to combine values into one field using T-SQL. This method is particularly handy when you don’t know ahead of time how many values will be returned. This simple example would return a student’s name and list of professors (separated by commas). SELECT stu.FullName, (SELECT prof.FullName + ', ' FROM tblProfessors prof INNER JOIN tblStuProf stuprof ON prof.ProfID = stuprof.ProfID WHERE stuprof.StuID = 1234 FOR XML PATH('')) AS Professors from tblStudents stu where stu.StuID = 1234 ...
This post goes over how to display images stored in a database using the SlideShowExtender control. The examples use VB.Net (what I have to use at the office) and assumes that you are storing your images in a database, have a way to retrieve the images from the database (e.g. stored procedure) and have AJAX (example is based on the AJAX controls in VS2008) setup in your ASP.Net project already. Also the example was based on retrieving images that are photos hence the names of some of the various ...
A few months ago I attended a local user group meeting that focussed on software security. The presenter demonstrated several techniques that one could employ to bypass software security and several “tricks of the trade” that one could implement to make ones software more secure. The presentation rekindled the fire I had for a little research project that I had attempted several months earlier on reverse engineering .Net applications but that at the time I had lost interest in after an hour of unsuccessful ...
In this Issue: Phil Middlemiss Justin Angel, Kunal Chowdhury, Emiel Jongerius, Microsoft, Channel 9, András Velvárt, Timmy Kokke, Microsoft Expression Blog, Jesse Liberty, and Jeremy Likness. Shoutouts: Jeff Weber announced Farseer Physics Engine 3.0 RELEASED, has a link to it and information about it. Jesse Liberty has posted The Great Silverlight Competency Test – Part 1 Chris Koenig announced Sharing the Light – Silverlight Development with Expression Blend... DFW Silverlight training with Victor ...
I recently read the book “C# 4.0” How-To by Ben Watson, published by SAMS, ISBN-13: 978-0-672-33063-6. I’m a primarily VB.net developer (hey I”m a VB MVP) but these days I find myself using C# more and more. This is a practical book; seeing exactly how to code various patterns in C# was very useful. The usefulness was three fold. First, as C# is not my 1st language, sometimes I stumble a bit when trying to express some code in C#. There are many many examples of using a very wide range of classes ...
This week, Scott Guthrie, Corporate Vice President at Microsoft’s Developer Division, announced, via blog post, the early Beta release of a new tool called WebMatrix. WebMatrix is a free developer tool that enables Web development geared toward what might I might call Markup-and-Script developers (more on that in a minute). And although WebMatrix draws upon technologies already, or soon to be, present in the fuller ASP.NET Web development platform and the Visual Studio integrated development environment ...
I was listening to Dot Net Rocks show #560 about F# and during the podcast Richard Campbell brought up a good point with regards to F# and a GUI. In essence what I understood his point to be was that until one could write an end to end application in F#, it would be a hard sell to developers to take it on. In part I agree with him, while I am beginning to really enjoy learning F#, I can’t but help feel that I would be a lot further into the language if I could do my Windows Forms like I do in C# ...
You can reach this page anytime at http://tools.michaelcrump.net Thanks to everyone that has contributed so far, we are getting several thousands hits from all sorts of developers a day. Recent Contributors include: Deependra Solanky, Grant, Klaus, James, BlueCollarCritic and Bob Koehn Tweet this list! Add a link to my site! Add me to twitter! This is a list of the tools/utilities that I use to do my job/hobby. I wanted this page to load fast and contain information that only you care about. If I ...
First up. Its actually really easy. I’m not very religious about my DB tech, I don’t really care, I just want something that works. So I’m happy to consider all options if they provide an advantage, and recently I was considering jumping from NHibernate to EF 4.0. However before ditching NHibernate and jumping to EF 4.0 I thought I should try the head version of NHibernates trunk and the Head version of FluentNHibernate. I currently have a “Repository / Unit of Work” Framework built up around these ...
I joined a fairly large project recently and it has a particularity… Once finished, everything has to be sent to the client under VS2005 using VB.Net and can target either framework 2.0 or 3.0… A long time ago, the decision to use VS2008 and to target framework 3.0 was taken but people knew they would need to establish a few rules to ensure that each dev would use VS2008 as if it was VS2005… Why is that so? Well simply because the compiler in VS2005 is different from the compiler inside VS2008… I ...
I am currently reading CLR via C# ISBN 978-0-7356-2704-8. Whilst quite correctly described by the publisher as a "Deep Dive", this is a book that C# developers with 6-18 months plus experiance ought to read. Certainly any serious Microsoft programming shop ought to have a copy. For our VB.NET bretheren, a book of this quality is a good excuse to learn C#. (And before you ask, my favourite language of C# and VB.NET is the one that gets me the next contract!) When I started programming 31 years ago ...
Sometimes when using Master Pages you need to set a property on a control from the content page. An example might be changing a label’s text to reflect some content (e.g. customer name) being viewed or maybe to change the visibility of a control depending on the rights a user may have in the application. There are different ways to do this but this is the one I like. First on the code behind of the Master Page create the property that needs to be accessed. An example would be: Public Property CustomerNameText() ...
Sometime you’re searching for something forever and when you find it, you realize it was right under your nose. Maybe you were distracted by other things around… or maybe that thing right under your nose was so well hidden that it deserves a blog post… That happened to me a few days ago while using the “Settings.settings” functionalities in my VB.NET application… I thought it was a cool feature and I decided to use it… So there I am adding new settings with “USER” scope and StringCollection as the ...
Hi all, This is the beginning of my blog. I have been a software developer for going on 11 years using the Microsoft toolset (primarily VB 5, VB 6, VB.net and SQL Server 6, 7, 2000, 2005, 2008). My coding interests are C#, ASP.net, SQL and XNA. Here I will post my musings, things of interest, techie babble and sometimes random gibberish. My hope for this blog is to document my learning experiences with C#, help, encourage and in some way be useful to those who come after me. Thanks for reading ...
Surface is magic. Everyone using it seems to think that way. And I have to be honest, after working for almost 2 years with the platform I still get that special feeling the moment I turn on the unit to do some more work. The whole user experience, the rich environment of the SDK, the touch, even the look and feel of the Surface environment is so much different from the stuff I’ve been working on all my career that I am still bewildered by it. But… and this is a big but.. in the end we’re still talking ...
Welcome to the introduction for what I hope will be the first of many blog posts in a series I’m calling “From Mort to Master”. My goal is to discuss some concepts and tools that I feel is important to the profession of software development, from the perspective of what many would consider a Mort. Who is Mort? “Mort” is one of the internal personas that Microsoft uses when referring to us as developers (specifically, I believe they use the personas for Visual Studio). They are, briefly: Mort: A developer ...
[22/12/09: I have been unable to get the podcast hosted on Channel 9 due to problems with the publishing platform. But Michael did a great job so I wanted to get it posted. Hence you can find it on Skydrive for the moment. Download from Skydrive ] A great chat with Michael Foord, author of IronPython in Action, on why a C# or Visual Basic .NET developer should look at also investing time in learning and using IronPython. Michael wrote an article on IronPython for the November 18th 2009 UK MSDN Flash ...
Between work, life and umm... more work, I haven't really had much time for blogging *lately. (*for varying definitions of lately, the most accepted being "several months.") It hasn't helped that 99% of the random crap I usually spew onto this blog could apparently be summarized in 140 characters or less. Looking back, I guess Twitter damn near killed this blog. That and being **extremely sick over the last few weeks didn't help much either. (**Diabetes sucks, whether you ignore it or not. I've tried ...
Just a decade and a half ago, the process of building a simple Windows-based application could have been described as a nightmare. The introduction of Visual Basic changed it so developers could for the first time implement Windows applications in an intuitive, graphical environment by dragging controls onto a form. The web revolution is here and now. Web had become very quickly the platform of choice for all kind of applications. The demand for web applications is ever growing and cloud computing ...
I’m a huge fan of NHibernate. It has excellent documentation and just makes the whole job of getting things into and out of the database much more enjoyable. There is a whole series of posts on NHibernate from one of the committers, Ayende. When Fluent NHibernate (FNH) came out, it was like butter on sliced bread. FNH makes it even easier to use NHibernate. Ayende had a post a while back on how to use Event Listeners. That helped me to get to event listeners set up. Event Listeners namespace somethingimportant.we.hope.... ...
In a project that I completed a few years ago I had need to programatically zip an xml file for use as an email attachment. This specific implementation was a part of a BizTalk Adapter written in VB.Net, but the code library used to carry out the zip process was a freely available C# library that can be used in any .Net code for zipping purposes. The library used was called SharpZipLib. The .Net SharpZipLib library (formally NZipLib) supports Zip as well as GZip format and comes with C# source code ...
Adding a new row to a datatable in a specific position is a snap. The scenario in this case would be that you have a datatable filled via a stored procedure that is also used in other applications so it can not be altered. The datatable is used to populate a dropdownlist and that list needs to have the always popular ‘Select All’ option as the first item. To add this in you could use code like what is listed below after the datatable is populated from the stored procedure. The example uses two columns ...
As a VB MVP and someone who really loves VB in general, this kind of news really makes me smile… Microsoft has heard your feedback that VB/C# content parity is a top priority for the VB community. Given that, this issue has become a top priority for the languages team. The Approach We’ve gone about a prioritized approach, in order to fill holes for the most important technologies and content types first. Here are some general guidelines we’ve used… Technologies are prioritized by the number of current ...
Doug Turnure has recently provided a lot more content to .NET University. .NET University is a site where user groups (or individuals) can download presentations, complete with spiffy slide decks and demos/labs. There are now over 40 downloads (both C# and VB.NET - Yay!) RV.NUG used .NET U back when .NET 3.0 was first released. We found the slides and demos were both excellent. (You can even see us on the alumnus page on .NET U!) This resource provides many opportunities to user groups. Here's my ...
Over the years, I have met many user group leaders (and been one myself a few times) and I often hear this question, or a variation of it... "I'm in a pinch, I can't find a speaker, I've got a new guy who wants to try speaking... Where can I get already prepared presentation materials to use at code camps and user group meetings?" Well... I am thrilled to announce that Doug Turnure from the Microsoft Marketing team has been leading an effort to compile these materials. He’s made about 40 presentations ...
Every now and again you may come across an error when trying to update a database from a data driven control (i.e. gridview, formview) that is tied to a SQL or Object data source. The errors usually are along the lines of “Could not find xxx that has parameters” along with a list of those parameters. Or an error that states there are too many parameters being passed. Aside from looking for typos, counting or lining up the parameters I will use one of these techniques to try and narrow down what may ...
Windows Embedded CE 6.0 R3 has been released yesterday, you can download it from here: http://www.microsoft.com/do... One of the most exciting new features of R3 is Silverlight for Windows Embedded. With this technology the UI of an application can be described using XAML, an XML-based language, and can be designed using visual tools like Expression Blend. This will allow UI designers to work on embedded devices using ...
Finally wrapped up the changes and bug fixes over the weekend for the VB.NET 3.6.3 version and Rocky Lhotka will be posting on his site shortly!
I presented “What's new in silverlight 3.0” at Teched, Delhi on roads and got overwhelming response for it. Actually there was two events. The venue for the first event was Microsoft office, Gurgaon, Delhi. I must admit i had to change gears because most of the attendees were new to “Silverlight” itself; and i was introducing them to Silverlight 3.0 version!! So i was back to questions like Why Silverlight? What silverlight means to Developer Architect Manager End user It did generated lots of interest ...
This past weekend was pretty awesome; the second annual St. Louis Day of .NET conference went underway. 2 DAYS! Can you believe it? It is 2 DAYS of (almost) all-you-can-eat technical sessions; and all for a minuscule $100 (or $125 for those late registrations). First off, some disclaimer: my comment on STLDODN ‘09 will be biased. Why? Because I participated in it and I’m rather involved in it, so of course I can’t quite badmouth it :). Organizers for the St. Louis Day of .NET 2009 are: Kevin Grossnicklaus, ...
*Moved to: Updating the Command Line ParserI had previously created a Command Line Parser from Ray Hayes codeproject article Automatic Command Line Parsing in C#. I had adapted it to VB.NET and upgraded it to .NET 3.5 but I recently ran into the problem with wanting a single command prompt application to handle multiple processes and multiple parameters. This would allow you to group all of a particular tasks commands into a single application. With the advent of Power Shell this format is increasingly ...
For a while now VB.net has has given us the ability to specify parameters in our method signatures as optional and provide a default value. Here is an example. 'Optional parameter using VB.net Public Function Add(ByVal Num1 as Integer, _ ByVal Num2 as Integer, _ Optional ByVal Num3 as Integer = 0) _ as Integer Return Num1 + Num2 + Num3 End Function The use of the Optional key word and by specifying a default value for Num3 means that when this method is called a value for Num3 can be omitted. This ...
Authors deserve more credit than they get. Coming up with a simple example to illustrate a principle is harder than it looks. Good authors have to do this all the time. They provide the examples that become anecdotal when describing the concept to a friend or colleague, and most of us, myself included, never take the time to think about the process. That was until today when I needed an example of Dependency Inversion to help explain the concept to a classmate. I must have thought up 10 or so bad ...
Recently we have to create methods that will manually compare 2 objects and see if they are equal – essentially check if all their properties / fields are equal. Some of the fields are Nullable Types, which have been available since .NET 2.0 (VS2005). It is a nice construct to have, especially to represent database fields that can also be null – this makes coding simpler because a nullable type can also contain null as a valid value. Interestingly, talking some some people that have done .NET for ...
Visual Studio 2010 and the .Net Framework 4.0 started getting the heat...Recently I saw a nice article on the new featurs of the VS 2010 and .Net framework 4.0. here is the list of new features. New Features in the Visual Studio 2010 IDE and .Net Framework 4.0 Call Hierarchy of methods A New Quick Search Multi-targeting more accurate Parallel Programming and Debugging XSLT Profiling and Debugging The XSD Designer New ASP.NET features Static IDs for ASP.NET Controls The Chart control Web.config transformation ...
This show is a bonus edition. It includes a brief overview of the announcements this week around Azure at the Worldwide Partner Conference in New Orleans and then a 30minute interview recorded at Qcon 2009 in London earlier this year. This time around, I am the interviewee for a change. Many thanks to Ryan Slobojan and InfoQ for letting me take the original video interview and create a podcast from it. If you prefer, you can watch the video on the InfoQ site. I was asked the following: Eric, what's ...
Antonio Chagoury, VB MVP, has constructed a list of Twitter accounts for VB MVPs, VB Team members, and others who are influential in the VB.NET community on his personal blog, CTO v2.0. This list has many great people who are not only talented in VB, but also who have great talents in many aspects of the .NET framework. I’m listed as a VB MVP, but if you don’t want the full list you can still check me out at http://twitter.com/svickn. However, I’d recommend checking out the rest of these guys too, ...