grdSelector.DataSource = GetSource(blah)
Dim dr As SqlDataReader = Nothing Dim sql As String = GetQuery(Blah) Dim con As New SqlConnection(Name.GetConnectionString) Dim cmd As New SqlCommand(sql.ToString(), con) cmd.CommandType = CommandType.Text cmd.CommandTimeout = 600 con.Open() dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) ' close the connection when the reader is closed Return dr
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
24 Experts available now in Live!