source code is as follows:
using System;
Using System. Collections. Generic;
//using System. Data. OracleClient;
Using System. Linq;
Using System. The Text;
Using Oracle. DataAccess. Client;
Using System. Windows. Forms;
The namespace Text. Connect. Demo
{
Class Program
{
The static void Main (string [] args)
{
OracleConnection conn=new OracleConnection ();
String connString="Data Source=(DESCRIPTION=(ADDRESS=(TCP) PROTOCOL=(HOST=117.29.161.242) (1521) PORT=) (CONNECT_DATA=https://bbs.csdn.net/topics/(SERVER=DEDICATED) (SERVICE_NAME=GJCARREVEN))); User Id=joysv2; Password=joysv2 ";
Conn=new OracleConnection (connString);
If (conn!=null)
{
MessageBox. Show (conn. ToString ());
MessageBox. Show (connString);
}
Try
{
Conn. The Open ();
MessageBox. Show (conn. State. The ToString ());
}
The catch (Exception ex)
{
MessageBox. Show (ex. Message. The ToString ());
}
The finally
{
Conn. Close ();
}
}
}
}
CodePudding user response:
Remove the Date the connString Source=CodePudding user response:
Prompt the DESCRIPTION is invalid fieldCodePudding user response: