O VB.NET usa controles ADO.NET para conectar ao banco e executar consultas. A instrução create table cria uma tabela diretamente pelo código, útil para tabelas temporárias ou instalação.
Instruções
Abra o Visual Studio e carregue o projeto VB.NET.
Adicione as bibliotecas no topo do arquivo:
Imports System.Data
Imports System.Data.SqlClient
Crie a conexão:
Dim connection As New SqlConnection
connection.ConnectionString = "Data Source=localhost;Initial Catalog=Customers;Persist Security Info=True;User ID=user;Password=2222"
Crie o comando:
Dim command As New SqlCommand("create table mytemptable", connection)
Execute com command.ExecuteNonQuery().