Create Fact Tables for Data Warehouse in VB.Net

Private Sub btnCreateFact_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreateFact.Click
Try
Dim tblerror As String
tblerror = “”

If (cbFTableName.SelectedIndex = -1) Then
tblerror = “Please select a Table Name”
End If
If ((tblerror.Length > 0)) Then
MessageBox.Show(tblerror + vbCrLf, “Information”, MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If

cmd.Connection = New System.Data.SqlClient.SqlConnection(ConnectionString)
cmd.Connection.Open()

sql = “CREATE TABLE ” + cbFTableName.SelectedItem.ToString + “(” + “RowID INT IDENTITY (0, 1) NOT NULL PRIMARY KEY, ” + sqlstrfact + strFKcmd + “)”
MessageBox.Show(sql)
cmd = New System.Data.SqlClient.SqlCommand(sql, cmd.Connection)

cmd.ExecuteNonQuery()
MessageBox.Show(“The table ” + cbFTableName.SelectedItem.ToString + ” was successfully created”)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

About these ads

One Comment on “Create Fact Tables for Data Warehouse in VB.Net

  1. Hey guys i wish to share with you a way i make $500 every day and i only spend 15 minutes doing it a day! Anyone can do it, you dont NEED to have a website. I strongly suggest you check their website out as there is really a brilliant video that explains each thing you have to know. Check them out at Mobile Monopoly. That’s the name of the System and i suggest should you own a web site that you at-least go and take a peak, you wont regret it…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 215 other followers

%d bloggers like this: