SQL COnnection String with Variables Syntax Error

Can anyone share the syntax for a SQL connection string that has variables for the different parameter values? Need to pass the values of some textbox fields into the connection string but I get an End of Statement Expected Error with my string in Visual Studio 20102:

Public SQLCon As New SqlConnection With {.ConnectionString = "Server=" + sServer + ";Database=" + sDatabase + ";User=" + sUser + ";Pwd=" + sPW + ";"}

0
edit delete
are you sure?
asked Anonymous user

0 answers

Post an answer but please log in first

Post Answer
  1. Please log in to post answer

Similar Questions

Tagsfor this question

Forumall questions