grab our rss feed

stevienova.com

Homepage of Steve Novoselac

Entries Tagged ‘Development’

C# 3.0 Features - Extension Methods

C# 3.0 and .NET 3.5 are out and ready for consumption, and I have been using some of the new features. One of the new features, Extension Methods, is really cool and can help you consolidate and reuse your code in a logical manner. Take for example, System.Data.DataSet - there is always something I do [...]

Comments (1) | 392 views

Don’t Be Afraid to Question "Why Are We Doing It This Way?"

"A boy asked his mother how come she cuts off the edges of a pot roast when putting it into the pot. Mother told him that that’s how her mother taught her to do. So, boy went to his grandmother and he got the same answer. Then he went to his grand-grandmother and ask her [...]

Leave a Comment | 203 views

.NET Programming - Stopwatch class in System.Diagnostics

So in two recent small little projects, I have needed to "time" things in code. Back in the day, it was using timespans, timers in windows forms, ticks, and just two dates and taking datediffs, getting the milliseconds or seconds, coverting to the time element you needed. Well, no longer do you have to hack [...]

Leave a Comment | 283 views

.NET - Fastest Way to Load Text File To SQL - SqlBulkCopy

An exercise in coding. Loading a text file to SQL. There are a billion different ways to do it, and depending on your source data format and such, you can parse the file a million ways too. But how fast can you get data from disk to SQL using .NET code? (VB.NET or C#) . [...]

Comments (12) | 3,907 views

VBA - Reading a Base64 Element into XML and using as Byte Array

Ok, more VBA
Getting a response back as Base64, but when trying to convert it from XML to binary data just having issues.. coming back as ASCII which converts wacked.
What you need to do:
Dim MyInfo As MSXML2.IXMLDOMNodeListSet MyInfo = xmlDoc.getElementsByTagName(”MyBase64Element”)MyInfo .Item(0).DataType = “bin.base64″
Dim image() As Byteimage = MyInfo .Item(0).nodeTypedValue
then you can use it in a byte [...]

Comments (2) | 282 views

MSXML2.IXMLDOMNodeList - Loading XML from files or strings

Again with the VBA, working with MSXML2.IXMLDOMNodeList objects. How do you load XML? Well MSDN shows you how to do it from an XML file..
Loading from an XML File:
Dim MyIXMLDOMNodeListVar As MSXML2.IXMLDOMNodeListDim xmlDoc As New MSXML2.DOMDocument30
xmlDoc.Load “c:\myxml.xml”
If (xmlDoc.parseError.ErrorCode <> 0) Then   Dim myErr   Set myErr = xmlDoc.parseError   MsgBox (”You have error ” & myErr.reason)Else   Set [...]

Leave a Comment | 633 views

VBA vs VB.NET - turn bytes into bitmaps

So, recently working on some things, I have noticed the HUGE difference between VBA and VB.NET, specifically with turning bytes into bitmaps.. (assume GiveMeBytes() returns a byte array that is a bitmap)
VB.NET:
Dim image As Byte() = GiveMeBytes()Dim memStream As MemoryStream = New MemoryStream(image)Dim bitImage As Bitmap = New Bitmap(System.Drawing.Image.FromStream(memStream))
bitImage.Save(”C:\test.bmp”)
 
VBA:
Dim image() As Byteimage = GiveMeBytes()
Dim bitImage
bitImage [...]

Leave a Comment | 1,060 views

Programming Home Projects - Like Playing Nintendo?

Ever since I started programming, I have always had some crazy idea on the side that I would be working on, some project, some program I could write. A few have seen the light of day (Fat Finger Media Center, Pocketblogger, amongst others..). I was thinking tonight, and it dawned on me. Doing development projects [...]

Comments (6) | 212 views

Source Control At Home: Subversion (SVN/TortoiseSVN)

Today, Joel asked me what to do to get source control going at his new job since they don’t have any. He mentioned I have never blogged on SVN or TortoiseSVN at all, so , here goes :)
Currently I am using Team Foundation Server (TFS) - which is nice, integrates with VS2005, etc. But really [...]

Comments (1) | 433 views

Importing Data From Excel Gotcha - The Top 8 Row Rule

I have ran across this a couple times now, I actually had a blog post draft written up for this but never got around to finishing it, well this week I ran into the issue again, so here it is.
Importing data from Excel (using whatever - C#, VB.NET, SSIS, Access, etc) - you have data [...]

Leave a Comment | 286 views