12/29/2012

And now for some .net

With all the new learning I've been doing, I decided to go old school and see about .net again.

I programmed in .net in 2003-6 and a bit after that, except I wanted to see if I could still do it.

So first I loaded up Visual Studio 2008 r2 and downloaded some sample code from http://www.planetsourcecode.com.

Except the program I downloaded required AJAX.

So I downloaded AJAX and got it's sample web to run okay.

However, there was a mixup between the 3.5 and 4.0 dot net framework.

So I decided to create a simple CONSOLE application.

Which I got to run.

So then I decided to connect to my SQL-Server 2008 r2 database.

Which after some tinkering, success, I was able to produce the results of a SQL table to the console and loop through all the records.

Took some work to get the configuration settings from the app.config but its working.

Imports System

Imports System.Configuration
Imports System.Data.SqlClient


Public Class vbMyClass
    ' Shared variables

    Dim connectionSting = ConfigurationManager.ConnectionStrings("ConsoleApplication1.My.MySettings.ReportServerConnectionString").ConnectionString
    Dim con As SqlConnection = New SqlConnection(connectionSting)
    Dim cmd As SqlCommand

    Public Sub ShowData()
        cmd = New SqlCommand("Select * FROM Catalog", con)
        If con.State = ConnectionState.Closed Then con.Open()
        Dim sdr As SqlDataReader = cmd.ExecuteReader()
        While sdr.Read = True
            Console.WriteLine(sdr.Item("ItemID").ToString & " " & sdr.Item("Path").ToString)
        End While
        sdr.Close()
    End Sub
End Class

This part of .net hasn't change much to be honest.

What has changed is the JSON, jQuery and MVC.

A co-worker gave me some work to do in MVC a few months ago, except it really didn't make much sense, same as today.

I'd like to build up to that eventually, but for now, I'd like to get .net back on my resume.

I currently support a few web services in production which I've had to modify recently.

One's a REST service and the other is an actual SOAP web service, both ODATA.

So sure I feel good connecting .net to SQL, the building block for developing webs and services and web services and client server apps.

Fun stuff to do on a day off from work.  I'd prefer to have the latest version of Visual Studio installed, maybe down the road.

That's it for now, JB

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Thoughts to Ponder