Not a long story.
1) Create a connection
2) Create a command containing the same SQL you would use to create it manually
Dim strSQL As String = "CREATE TABLE GRP_CONFIG ( " + _
"SHORT_NAME VARCHAR(8) NOT NULL " + _
"TG_NAME VARCHAR(8) NOT NULL )"
Dim csb As New SqlConnectionStringBuilder("connection info goes here")
Dim conn As New SqlConnection(csb.ToString())
Dim cmd As New SqlCommand(strSQL, conn)
say I want to create a table upon clicking a button. Will I insert the whole thing within the sub of the button including the 'Imports System.Data.SqlClient'? And there is a module there. Don't really know where to put things here...
I would put that in a different Sub -- actually I would make it a function that returns a Boolean (false if table not created) and then call it from the button push.
I would not put all of that code IN the button-push itself.
As a matter of fact, if you're doing a lot of database interaction, you could make a new class of database related code and put it there.
I have just heard of them and in my Myapp.config file, there are computer-generated codes there where I saw something like it. So how would the code look like? Can you just repost it here? The table creation takes place when a button is clicked.
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...