code:
Dim strconx as string = "Provider=SQLOLEDB;Driver ={SQLServer};server=10.145.53.249;database=emslog;uid=opt2;pwd=opt2@99;"
Dim strconx2 as string = "Provider=SQLOLEDB;Driver ={SQLServer};server=10.145.53.209;database=nc;uid=nc;pwd=nc123;"
Dim MyConall = New SqlConnection(strconx,strconx2)
error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30516: Overload resolution failed because no accessible 'New' accepts this number of arguments.
Source Error:
Line 16: Dim MyConall = New SqlConnection(strconx,strconx2)
Line 17:
Line 18:
การเรียกใช้
dim abc1 as String = ConfigurationManager.ConnectionStrings.Item("ชื่อของConnection1").ToString
dim abc2 as String = ConfigurationManager.ConnectionStrings.Item("ชื่อของConnection2").ToString
หรือ
Dim mycon As SqlConnection = New SqlConnection(abc1 )
Dim MyConall = New SqlConnection(abc1 )