Code:
"Data Source= """ & txtDatabase.Text & """; " & _
"Persist Security Info= False"
That looks confusing but it's not a typo.
Visual Basic uses double quotes to delimit strings. So what if you want to put a double quote inside a string? If you tried
"apple " banana" it would think the middle quote closed the string and wouldn't know what to do with
banana".
To tell Visual Basic to include a quote within a string, you double it, so in this example would use
"apple "" banana".
When the double quote comes at the beginning or end of a string, you get three in a row, which looks particularly odd.
So here's what the original code looks like if I replace the quotes inside the string with an X so it's easier to see:
Code:
"Data Source= X" & txtDatabase.Text & "X; " & _
"Persist Security Info= False"