Frequently Asked Questions, or Frequently Requested Code (FRC?)


Hey folks…. I’ve been thinking (dangerous, I know) and I’ve decided that you need to see more code. This might mean more code in this blog, more on the site, more pointed to that lives on other sites…. whatever, just more code in the end. I’m looking for topics though, what do you see as the most common topics that need code snippets? What comes up again and again when you are on the newsgroups and on the web forums out there?

Should we (MSFT, VB Team, Me, etc…) focus on the simple stuff for beginners or is that all covered on other sites and in the docs? Should we be focusing on those top few percentage of hard problems that very few folks have a good example for?

I’m leaning towards the ‘simple’ samples at the moment, like my printing example a few weeks back, and considering doing a simple data-entry application as a demo, then perhaps an application that uses the WebBrowser COM control (it comes up a lot on the forums I frequent)… and then, despite having already written an article on it, something involving multiple forms and passing data back and forth…

If you have any ideas or if you are just sick of answering a particular question over and over again (or asking it, and not getting a good answer) then just let me know.

[Listening to: Man on the Moon – R.E.M. – In Time: The Best of R.E.M. 1988-2003 (05:14)]
Comments (23)

  1. Jason Mauss says:

    There seems to be a lot of requests for a "Hello World" example. I’ve seen it all over the place.<g>

  2. Jerry Pisk says:

    Personally I’d like to see the advanced code, anybody with a little time can write a "Hello World" app in a language and environment they’ve never seen. Just RTFM.

    But if you’re going to post simple samples at least do it right, do include input validations, write secure code, handle error conditions, do not take any shortcuts.

  3. Jerry says:

    Simple samples like hello world are ok – but the other simple stuff – with a little googling you can find nearly everything – what gives me a hard time is always WMI, APIs, System Management Stuff, Network Stuff, etc.

    But actually I realy want to see fancy samples – like how to use BlueTooth APIs on XP SP1

  4. Roger Bonine says:

    I agree, I’d like to see the more difficult samples as well, including WMI and system management. To name one example, I’ve been searching for VB.NET sample code that initiates a Remote Assistance session for some time now. The only examples that I can find on MSDN are in C and VBscript.

  5. DarthPedro says:

    There always seems to be lots of questions on customizing WinForms controls, hosting the WebBrowser control in your app, and getting a WinForms control onto a web page.

    Also, a lightweight control that displayed simple HTML formatting. Rather than having to load the WebBrowser control when someone wants to display simple HTML with text, <b>, <i>, lists, links, etc.

  6. JJ says:

    What is the best way to do math (such as integration, data regression…) in VB without writing to much code?

    Could I get code for frequently use math functions some where?

  7. I’d like to see real examples. For instance, everyone is linking to the MSDN DateTime best practices article. The article lists the #1 best practice and then, in the very first sentence under that heading, instead of showing how to use that practice, tells of the way that many people work around it. The actual best practice is never demonstrated in the article, only secondary, lesser methods.

  8. You’ve been Taken Out. Thanks for the post.

  9. Bibhu Mohapatra says:

    I was wondering how to change the backcolor of sstab.

    do reply me soon kindly..

    Thanks..

    Bibhu

  10. I was wondering how to change the backcolor of sstab.

    do reply me soon kindly..

  11. Amberite says:

    Please, please please no more beginner’s code! I don’t think that many beginners in the first place would really be looking at this site in the first place, and anyways the simple stuff can be found all over the internet.

    However, I wouldn’t say to go into the obscure, really complex stuff either (that MSDN sometimes publishes).

    Pick a happy medium — popular topics that are of interest to intermediate/advanced programmers.

  12. Chas Dorsey says:

    I would prefer to see simple examples of code with comments where one should include validation code. Since I’ve been a programmer for 20 years, but just learning VB, I want to quickly see the basic syntax. I can figure out the supporting code.

  13. Chris K says:

    I am trying to figure out how to create a control that allows me take a record from a web data grid object and and drag and drop it on another object to write to one of the fields. Is there an existing drag and drop control that I can use on a web form or do I have to create my own control?

    For example a financial transaction

    date Description category amount

    3/5/04 Albertsons <not defined> 115.67

    on to

    a category sum total object(Groceries) = text.box =

    End result

    dataset record =

    date Description category amount

    3/5/04 Albertsons Groceries 115.67

  14. Javad says:

    How can I define a global variable that I can

    refer to from every form in the project ?

  15. Michael Jordon says:

    I think since most of the business applications use Database, I would prfere that some really cool and real work examples are posted to the code centre. Validation, Master Detail, Grid, Editing in Grid, Reports both in text format, export to other formats.

  16. Joku says:

    It’s sometimes annoying how most of the code around the net happily skips all the error handling and validation etc. In a book it’s understandable, but as a beginner-intermediate when i see how everyone else skips that important code, it’s easy to get the feel that you can get without it, atleast for a while.

    Also some discussion as to why something was done like it was would be nice, perhaps explaining why this is ‘the best practice’.

    I’d prefer the examples use async IO where applicable. There’s certain cases in .NET when beginner wants to do IO he will find himself having big problems when using synchronous IO, i’ve had this several times. Then i learned after ton of research into the matter that async is the only way to get something serious done.

  17. hello… please help me !!!

    please…

    I Want send a data to Com port in Visual Basic..

    Please give me Commands in Visual Basic relation Com port with a example …

    Thank you .

    I am waiting …

  18. Remote Mike says:

    I am a vb6 developer and want to explore vb.net and asp.net now.

    What about a reusable database-application skeleton for vb.net and asp.net? I mean, if you break it down to the essentials, what do I need to get started ?

    -An Access Table with 5 fields (1 String, 1 Date, 1 integer, 1 currency, 1 boolean)

    -A List Records/Filter dialog

    -A Find Record dialog

    -An edit/update/delete/cancel dialog with reuseable validation code for each type of the fields

    -A reuseable Errorhandler

    -One Report with the five fields

    That’s all, I guess, and it will help a lot.

  19. Steve WI says:

    I too am a VB6/ASP developer that is in need of some sample code for .NET. I have wrote several sites with shopping carts. What is different in doing this in .NET? I used classes and ASP. Is this still the preferred way in .NET. I am trying to put together a horse training site for a friend and would like to do it with the latest and greatest like XML to SQL Server 2000 and .NET. Any ideas or existing code that I can look at?

  20. I am Vb.NET and C# developer and i would like to see more code on web mining, building multi-threaded web applications and data mining html documents

  21. marygrace rice says:

    pleas releas cods to ninja gaiden on xbox

  22. Matt says:

    I want to see more *GOOD* code.

    The VB samples that MSDN publishes are just awful. I mean really, really awful. Awful variable names. Awful error checking. Awful assumptions.

    Anyone using MSDN code samples as a learning tool is teaching him/herself to be an awful programmer.

    I’d like to see some of the sample code ‘fleshed out’ into more real-world examples, with error checking, good variable names, option explicit and option strict turned on, etc. Let’s see sample code that could pass a code review!

    Specific ideas:

    I second DarthPedro’s request for a lightweight HTML control. I need one real soon in my project!

    An overview of namespaces and assemblies and real world sample implementations, to help the VB6 to VB.NET transition.

    Security. How to implement security in VB.NET *properly*. Tools that the compiler and the CLR give us to implement security in our apps.

    Scripting. Samples on how to integrate scripting into our apps. (Hosting a script engine opens worlds of possibilities, but the iVSASite interface is poorly documented, and the sample VB implementation mentioned in "Script Happens.NET" doesn’t exist.)

    Multithreading. How to do it right.

  23. murugu says:

    how will u open a simple excel file using visual basic