Assistance w/ VB.Net data connection

I've taken over a project to convert a VB6 app into VB.Net, the application was started but not finished.  I'm very familiar w/ VB6 but not so familiar w/ VB.Net...  I've looked at DBProviderFactory on the MSDN site.  Essentially I'm getting by but the database connection process seems alien to me so I'm hoping that someone out there can help me get what I need to get done.  I'm trying to use this process to grant access permissions to tables and databases.  I'm just not sure how to simply execute the SQL and not return results. (other than success/failure)  I don't really understand how this connection works, it's much different than ADO in VB6, I can't seem to find an 'con.Execute' command.  Here's what I have thus far, I apologize for the potential mess you're about to see...  I've tried to piece together stuff the web and stuff that was entered by the previous dev to get the result I want:

If rblGrntRvk.SelectedValue = "0" Then
            'GRANT
            SqlQuery.Append("GRANT ")
            SqlQuery.Append(txtRights.Text.ToString)
            SqlQuery.Append(" ON ")
            SqlQuery.Append(txtObj.Text.ToString)
            SqlQuery.Append(" TO ")
            SqlQuery.Append(ddUsers.Text.ToString)
            SqlQuery.Append(";")
        Else
            'REVOKE
            SqlQuery.Append("REVOKE ")
            SqlQuery.Append(txtRights.Text.ToString)
            SqlQuery.Append(" ON ")
            SqlQuery.Append(txtObj.Text.ToString)
            SqlQuery.Append(" FROM ")
            SqlQuery.Append(ddUsers.Text.ToString)
            SqlQuery.Append(";")
        End If

        SelStmt = SqlQuery.ToString()

        Dim pf1 As DbProviderFactory = DbProviderFactories.GetFactory("Teradata.Client.Provider")
        Dim con1 As DbConnection = pf1.CreateConnection()

        sConnection = "Data Source=" + Session.Contents("DataSource") + ";User ID=" + Session.Contents("AdminLogin") + ";Password=" + Session.Contents("AdminPasswd")
        con1.ConnectionString = sConnection

        Try
            con1.Open()

            Dim command1 As DbCommand = pf1.CreateCommand
            command1.CommandText = SelStmt
            command1.CommandType = CommandType.Text

            Dim adapter As DbDataAdapter = pf1.CreateDataAdapter()
            adapter.SelectCommand = command1

        Catch ex As Exception

        Finally
        End Try
        Exit Sub
EDW_GideonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

käµfm³d 👽Commented:
Ditch the DataAdapter. Just use the ExecuteNonQuery method of your command object:

command1.ExecuteNonQuery()

Open in new window


In other words:

...

Try
            con1.Open()

            Dim command1 As DbCommand = pf1.CreateCommand
            command1.CommandText = SelStmt
            command1.CommandType = CommandType.Text

            command1.ExecuteNonQuery()

        Catch ex As Exception

...

Open in new window


"NonQuery" in this case means any query that would not return data. INSERT, UPDATE, and DELETE statements fit this bill. A SELECT would not (though technically you could still execute a SELECT by way of that method).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.