Creating Tables

tehon3299

Well-known member
Joined
Jan 6, 2003
Messages
155
Location
Liverpool, NY
Hey -

How would I create an SQL table on an ASPX page? If I use:
Code:
Create Table tbMisc
then it say Create is not defined? Whats the problem? I have Import Namespace="System.Data.Sqlclient". Any ideas?

Thanks
 
try this...
Code:
            Dim con As New SqlConnection("server=127.0.0.1;Trusted_Connection=yes;database=Northwind")
            con.Open()

            Dim cmd As New SqlCommand("CREATE TABLE Test (Col1  Text, col2 Text)", con)
            cmd.ExecuteNonQuery()
            con.Close()
 
Code:
Dim cmd As New SqlCommand("CREATE TABLE " & TextBox1.Text.ToString & " (Col1  Text, col2 Text)", con)
 

Similar threads

J
Replies
0
Views
59
Jalil Sear [MCPD SharePoint]
J
D
Replies
0
Views
931
Dante Havenaar
D
D
Replies
0
Views
768
DexterCamarillo
D
Back
Top