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.

No comments: