Now i have stumbeld into onother problem, i need to insert into 2 tables at the same time the same data.
Code:
Dim con AsNew SqlConnection(ConfigurationManager.ConnectionStrings("test").ConnectionString)
Dim cmdd AsNew SqlCommand("INSERT INTO " & l & " Campaign(Template, CampaignName) VALUES(@Template, @CampaignName)", con)
cmdd.Parameters.Add("@Template", Data.SqlDbType.VarChar, 50).Value = Me.ListBox1.SelectedValue
cmdd.Parameters.Add("@CampaignName", Data.SqlDbType.VarChar, 50).Value = s
con.Open()
cmdd.ExecuteNonQuery()
con.Close()
" & l & " is table 1 when i try to run the statement i get
Incorrect syntax near 'Campaign'.