Torna al Thread

Dim myconn As New SqlClient.SqlConnection Dim mycomm As New SqlClient.SqlCommand myconn.ConnectionString = "Data Source=localhost\SQLEXPRESS;Integrated Security=True;Database=test" mycomm.Connection = myconn Dim datasc As Date = #1/1/2012# Dim txt2 As String = "nvarchar(max)" Dim txt1 As String Dim txtglobal As String = "Idfasullo int" Do Until datasc = #1/1/2013# txt1 = "date_" & datasc.Date.ToString("ddMMyyyy") txtglobal = txtglobal & ", " & txt1 & " " & txt2 datasc = DateAdd(DateInterval.Day, 1, datasc) Loop mycomm.CommandText = "CREATE TABLE TabloidSpiaggia(" & txtglobal & ")" Try myconn.Open() mycomm.ExecuteNonQuery() myconn.Close() 'mycomm.Parameters.Clear() MessageBox.Show("OK") Catch ex As Exception MessageBox.Show(ex.Message) End Try
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5