Last post Nov 05, 2015 09:24 AM by Lokesh B R
Nov 05, 2015 09:20 AM|sudip_inn|LINK
see the code i use using with connection and though when command will execute then connection will open implicitly but got error and i had to add this line
cmd.Connection.Open(); to open connection explicitly.
just like to know connection is not open implicitly or do we need to open it explicitly ?
after executing ExecuteNonQuery connection will be closed or disposed automatically or we need to close it manually writing code there? let me know. thanks
using (SqlConnection connection = new SqlConnection(Business.SQLDB.ConnectionString))
SqlCommand cmd = new SqlCommand("update MyTable set CID=@CID WHERE ID=@ID",
Nov 05, 2015 09:24 AM|Lokesh B R|LINK
We need to Open the connection and the using() will automatically dispose the connection.