Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Hi there, I want make a script with gui, that connects to a database, runs a query and returns the results. I want to use textboxes to create the connectionstring.
  2. My problem is, If i run it, without gui, it works perfectly, but when I want to use textboxes, it returns an error, but only for the User ID.
  3. Help?
  4. This works fine:$scon.ConnectionString = "Data Source=localhost;Initial Catalog=adventure;Connection Timeout=0;User ID=sa;Password=****;"
  5. This isn't:
  6. $instance = $txtbox_instance.Text
  7. $catalog = $txtbox_dta.Text
  8. $usr = $txtbox_name.Text
  9. $pass = $txtbox_pass.Text
  10. $tempstring = "Data Source=$instance;Initial Catalog=$catalog;Connection Timeout=0;User ID=$usr;Password=$pass;"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement