Skip to content
Loading
  • +3
    hello amit i put try and catch
     
    give this error in catch block
     
    when I debug first time then give this error : Internal connection fatal error. Error state: 15, Token : 54 
     
    when I debug second time then give this error :Invalid attempt to call Read when reader is closed. 
    +3
  • Amit Gupta
    +3
    Make sure to close the connection properly after its usage.
     
    As you are closing the form immediately while the work is in progress, it must fall in try catch block (that I mentioned) as a ignoring or logged message.
     
    Morover, try to avoid static functions as much as you can because it holds the memory until your application closes 
    +3
  • +3
    yes give an error see below image
     
     
     
    OperationSql.cs
     
    public static bool OpenWebConnection(EnumServer ServerCon);
    public static bool OpenConnection(EnumServer ServerCon); 
    public static bool ReadDatabaseSettingBranch(EnumServer pEnumServerName);
    public static bool IsConnectionCheck(EnumServer ServerCon); 
     
     

    I have no idea which command is use to open the connection because here not sqlconnection related syntax
    that is issue
     
    can you more help 
    +3
  • Amit Gupta
    +3
    The error clearly specifies that you don't have an open connection to perform your query.
     
    Goto their definition and check the connection is opened/closed, perform it accordingly, as we can't help when you share limited resources with us 
    +3
  • +3
    trying and trying but not solve the error 
     
    it is not sql syntax that is issue
    +3