Monday, August 30, 2010

Monday, August 30th 2010

I'm going to redo and expand upon a tutorial from an O'Reilly book.

first things first, drag and drop the ToolStripContainer control onto the form.

Seriously, what is the point of the ToolStrpContainer?

Setting up the pubs database was quite hard, the tutorial wanted me to use visual studio, but I ended up just doing it with SQL server



Dim result As DialogResult = Dialog1.ShowDialog()
If result = Windows.Forms.DialogResult.OK Then
End
End If


A weird thing from the tutorial



Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Dim result As DialogResult = Dialog1.ShowDialog()
If result = Windows.Forms.DialogResult.OK Then
End
Else
e.Cancel = True
End If
End Sub


Why did this have to be set up separately? I am not really what is going on here but I am just going to do it and hope that it makes sense one day.

Apparently, VB.net has several templates, including an about-box template, and an explorer form. which has a built-in tree view. Cool beans.

Thursday, August 26, 2010

Thursday, August 26 2010

Finally got something to work


Dim conServer As SqlConnection = New SqlConnection("data source =ALFRED-PC\SQLExpress; initial catalog=database_Alfred; User ID=sa; password=china")
conServer.Open()

If conServer.State = ConnectionState.Open Then
lblConnection.Text = "SQLConnection is Open"

ElseIf conServer.State = ConnectionState.Closed Then
lblConnection.Text = "SQLConnection is closed"
End If


I'm going to full around with making my own projects, although I realized that I dutifully need to go back to tutorials as well.

I have a couple of projects that I want to work on:

1.) calculating salary, the percentage taken out by federal tax, the percentage taken out by state tax
-THEN- the cost of an item, the additional sales tax, and the percentage of your net income that it would take out

2.) calculating compound growth

I added a lblConnection.ForeColor = Color.Blue to the code above, which was nifty.

I modified my SQL DB with the following Transact-SQL code



USE database_Alfred
GO
CREATE TABLE investments
(
CompanyNumber int NOT NULL,
Ticker char(7) NOT NULL,
Name char(70) NOT NULL,
PurchasePrice int NOT NULL,
)


This was the first time for me to add a reference.

Wednesday, August 25, 2010

Wednesday, August 25 2010

I am trying to develop my own small app as a way of learning VB.

Right now I am focused on using ADO.NET to create a new record in a SQL Server DB using information taking from a VB windows application.



Imports System.Data.SQLClient


System.Data.SqlClient is a namespace.

I have to remember to right click and run visual studio as an administrator. Thank you Windows 7

Monday, August 23, 2010

Monday, August 23 2010

I wrote my first mini console application today. It was nothing impressive.

I took a look at the WebBrowser Control which is very cool.

I also reviewed some rudiments of Visual Basic using LearnVisualStudio.Net which is an alright site.

Friday, August 20, 2010

Friday, August 20 2010

The simplified syntax of the SELECT statement



SELECT select_list
FROM table_source
[WHERE search_condition]
[ORDER BY order_by_list]

Thursday, August 19, 2010

Thursday, August 19th, 2010

Today I am going to take a look at SQL server (hopefully) using yet another tutorial using Murach - (). They do make excellent books, although I felt (feel) that the VB book "jumps" a bit.

Client/Server System - has three parts, a client which I would call the user terminal (?) that is basically a PC in most cases, the Database server and the Network itself, cables, routers, etc.

(LAN) and (WAN) - one is a local area network, the other is a wide area network.

SQL stands for Structured Query Language and apparently you can pronounce it "S-Q-L" if you wish.

Back-end processing versus front-end processing - back-end processing is done by the database management system, whereas front-end processing is done by the application software.

Columns are vertical (like columns in a building) and rows are horizontal.

A foreign key is one (or more) column in one table that refers to a column in another table.

The most common data manipulation language (DML) SQL statements are SELECT,INSERT,UPDATE, and DELETE.

The most common data definition language(DDL) SQL statements are CREATE DATABASE, CREATE TABLE, CREATE INDEX, ALTER TABLE, DROP DATABASE, DROP TABLE, DROP INDEX

Wednesday, August 18, 2010

Wednesday, August 18 2010


Private Function IsValidData() As Boolean
If Not IsPresent(txtMonthlyInvestment, "Monthly Investment") Then
Return False
End If
If Not IsDecimal(txtMonthlyInvestment, "Monthly Investment") Then
Return False
End If
If Not IsDecimal(txtMonthlyInvestment, "Monthly Investment") Then
Return Faslse
End If
If Not IsWithinRange(txtMonthlyInvestment, "MonthlyInvestment", 1, 1000) Then
Return False
End If


One of the things Anne Boehm shows us in her tutorials is how to use compound conditions in a single return statement, rather than use a series of simple if statements.

I've also been watching a series of videos that MIT provides for free online - right now I am watching Prof. Eric Grimson and Prof. John Guttag talk about computational thinking.

A big problem with all this I can tell is that I am ignorant of SQL server and terrified of databases, so I am going to try educating myself on SQL server.