动态组合 提示初始化字符串的格式不符合规范 何解?
按钮事件代码如下:
Dim cr As new cr.class1
Dim a1 As String = """" & "Data Source= " & e.Form.Controls("TextBox1").text & ";"
Dim a2 As String = "Initial Catalog= " & e.Form.Controls("TextBox2").text & ";"
Dim a3 As String = "user id= " & e.Form.Controls("TextBox3").text & ";"
Dim a4 As String = "Password= " & e.Form.Controls("TextBox4").text & ""","
Dim a5 As String = """" & e.Form.Controls("TextBox5").text & ""","
Dim a6 As String = """" & e.Form.Controls("TextBox6").text & ""","
Dim a7 As String = """" & e.Form.Controls("TextBox7").text & ""","
Dim a8 As String = """" & e.Form.Controls("TextBox8").text & ""","
Dim a9 As String = """" & e.Form.Controls("TextBox9").text & """"
Dim str As String = a1 & a2 & a3 & a4 & a5 & a6 & a7 & a8 & a9
e.Form.Controls("TextBox10").text=str 【显示在文本框里的内容和字符是符合标准的】
cr.CreateDatabase("Data Source=" & e.Form.Controls("TextBox1").text & ";Initial Catalog= " & e.Form.Controls("TextBox2").text & "; user id=" & e.Form.Controls("TextBox3").text & ";Password=" & e.Form.Controls("TextBox4").text & """", """"& e.Form.Controls("TextBox5").text &"""",""""& e.Form.Controls("TextBox6").text &"""",""""& e.Form.Controls("TextBox7").text &"""",""""& e.Form.Controls("TextBox8").text &"""",""""& e.Form.Controls("TextBox9").text &"""")
提示错误:
此主题相关图片如下:111.png
想实现红色部分 能够实现如下格式的内容
cr.CreateDatabase("Data Source=DESKTOP-4HGMIGM\SQLEXPRESS;Initial Catalog=master; user id=sa;Password=com", "文件管理","c1","d:\文件管理.mdf","c2","d:\文件管理.log")