21
Reply

when connection will close in disconnected architecture if I dont use conobject.close() method?

Srikanth Reddy

Srikanth Reddy

Feb 13, 2017
2.3k
0

    we can use statement using(sqlconnection con=new sqlconnection()) { }

    Suresh Molabanti
    April 25, 2017
    3

    no need to close the connection

    Rajkiran Swain
    May 15, 2017
    2

    Disconnected architecture means, you don’t need to connect always when you want to get data from the database. You do not need to open the connection explicitly. Once we fill data in dataset or datatable using fill method , the connection gets closed automatically.

    Bhola Parit
    April 05, 2017
    2

    if you dont use conobject.close() method connection will close (in disconnected architecture) if it sat idle for certain period of time automatically.

    Sulekh Kumar
    March 28, 2017
    1

    use try{} ,catch{}, final{} ,or use "using{}"

    Suresh Kumar
    October 28, 2017
    0

    con.disposed()

    Ganesh Kharde
    October 16, 2017
    0

    Using

    Mukesh Kumar
    September 20, 2017
    0

    Using block

    Mukesh Kumar
    September 10, 2017
    0

    By using "using {}" block

    Mukesh Kumar
    September 02, 2017
    0

    In using{}. Block

    Mukesh Kumar
    August 29, 2017
    0

    by the use of using{} block

    Mukesh Kumar
    August 29, 2017
    0

    by the use of using block like using{}

    Mukesh Kumar
    August 23, 2017
    0

    Its depend on code if use DataAdapter then this will auto open and close on .fill command. In other case when you use conobj.open() and execute some query and do not close the connection then its depend on connection time out property.

    Gopal Sharma
    July 28, 2017
    0

    No need to explicitly open and close the connection in disconnected architecture.

    Deepak Kumar
    July 26, 2017
    0

    No need to explicitly open and close the connection in disconnected architecture.

    Deepak Kumar
    July 26, 2017
    0

    After completion of the main method.

    Vishnu Reddy
    July 17, 2017
    0

    finally{if (cn != null && cn.State == System.Data.ConnectionState.Open){cn.dispose();}}

    Rajavel G
    May 12, 2017
    0

    You don't need to close the connection... It will automatic open and close the connection when needed.

    Dharmraj Thakur
    May 02, 2017
    0

    we can use statement using(sqlconnection con=new sqlconnection()) { }

    Suresh Molabanti
    April 25, 2017
    0

    we can use statement using(sqlconnection con=new sqlconnection()) { }

    Suresh Molabanti
    April 25, 2017
    0

    once your connection is Open which is paramount then closing it should not be a necessity. because there are sometimes that you will even forget to close your connection and your code will still run. so its not compulsory

    Lawrence Peters
    April 24, 2017
    0