View Single Post
  #4 (permalink)  
Old January 6th, 2009, 12:04 PM
dparsons dparsons is offline
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Any time you are working with Dynamic SQL there is the potential that something will go wrong, regardless if the only people using the tool are administrators!

If you want to continue using the same methodology that you are currently using I would probably do something like this:

vb Code:
Dim SQL as String
SQL = "CREATE TABLE " & textbox1.Text & " (ID Int,Name Varchar(50));"
SQL += "INSERT INTO " & textbox1.Text & "(ID, Name) VALUES(1, 'Name');"

Dim Cmd AsNew SqlCommand(SQL, conn)

What exactly are you doing that requires this type of functionality?

hth
-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================