MessageBox.show(e.ConnectionString)
If Connections.TryConnect(e.ConnectionString) = False Then
Dim config As String = e.ProjectPath & "config.txt"
If Filesys.FileExists(config) Then
Dim Result As DialogResult
e.HideSplashForm = True
Result = MessageBox.Show("连接数据库失败,是否读取系统目录下的数据源配置:config.txt","提示", MessageBoxButtons.YesNo)
e.HideSplashForm = False
If Result = DialogResult.No Then
Dim ps As System.Diagnostics.Process() = System.Diagnostics.Process.GetProcessesByName("foxtable")
For Each p As System.Diagnostics.Process In ps
If p.MainWindowTitle = Nothing OrElse p.MainWindowTitle.contains("公司管理系统") Then
p.kill
End If
Next
Else
Dim strs As String = FileSys.ReadAllText(config)
strs = strs.Replace(vblf,"")
Dim str() As String = strs.Split(vbcr)
Dim cn As String = "Provider=SQLOLEDB.1;Password=" & str(3) & ";Persist Security Info=True;User ID=" & str(2) & ";Initial Catalog=" & str(1) & ";Data Source=" & str(0)
MessageBox.Show(Connections.TryConnect(cn))
If Connections.TryConnect(cn) = True Then
If e.Name = "ERP" Then
e.ConnectionString = cn
End If
MessageBox.show(e.ConnectionString)
Else
MessageBox.show("连接数据库参数不正确,即将退出系统")
Dim ps As System.Diagnostics.Process() = System.Diagnostics.Process.GetProcessesByName("foxtable")
For Each p As System.Diagnostics.Process In ps
If p.MainWindowTitle = Nothing OrElse p.MainWindowTitle.contains("公司管理系统") Then
p.kill
End If
Next
End If
End If
End If
End If
MessageBox.Show("BeforeConnectOuterDataSource结束")
通过项目目录下的文本文件传入B的参数,但是报错,如下图

此主题相关图片如下:qq图片20150804165828.png

我通过MessageBox.Show,一直到本事件结束,都没有报错,请问怎么解决?