Home > Net >  Asp.net database connection of dreams (DM7), web way, always prompt 6001, communication error
Asp.net database connection of dreams (DM7), web way, always prompt 6001, communication error

Time:11-08


 # region execute SQL statements with variable parameters 
///& lt; Summary>
///the SQL execution with variable parameter
///& lt;/summary>
///& lt; Param name="Sqlstr" & gt; SQL statement & lt;/param>
///& lt; Param name="param" & gt; Variable parameter object array & lt;/param>
///& lt; Returns>
Public static int ExecuteNonQuery (String Sqlstr, params IDataParameter [] the parameters)
{
String ConnStr="Server=localhost; USER ID=SYSDBA; PASSWORD=SYSDBA ";
Try
{
Dm. DmConnection conn=new Dm. DmConnection (ConnStr);
conn.Open();
DmCommand CMD=conn. CreateCommand ();

Cmd.Com mandText=Sqlstr;
CMD. The Parameters. AddRange (Parameters);
Return CMD. ExecuteNonQuery ();
}
The catch (Exception ex)
{
Throw the ex.
}
return 0;

}
# endregion




CodePudding user response:

Your problem solved? I doubt that is the official to addrange method has a problem, don't know you is how to solve

CodePudding user response:

I also met the same problem, like link pool open to use it for a long time

CodePudding user response:

Give you a connection string template try & lt; DMConnect> Server=192.168.1.221:5236; User ID=SYSDBA; The PWD=PWD; The Database=datatablename;
  • Related