This is a migrated thread and some comments may be shown as answers.

Using keyword with radgrid needdatasource

1 Answer 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dana Cobb
Top achievements
Rank 1
Iron
Dana Cobb asked on 10 Apr 2013, 02:48 PM
When i bind a grid to a datareader in the needdatasource like this:

Dim rs As SqlDataReader = SqlHelper.ExecuteReader(GetConnectionString("mv4Conn", "mvdata", ConfigurationManager.AppSettings("CircViewDB")), Data.CommandType.Text, sbFilter.ToString)
               Me.RadGrid1.DataSource = rs

should i be using the USING keywod like this:

Using reader As SqlDataReader = getReader()
    ddlCustomer.DataSource = reader
End Using
 
to make sure that the datareader is disposed of?

thanks,
Dana







1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Apr 2013, 04:14 AM
Hi,

You can use reader.Close(); method to close the reader. Check the following help documentation which explains more about this.
Binding To DataReader

Thanks,
Shinu
Tags
Grid
Asked by
Dana Cobb
Top achievements
Rank 1
Iron
Answers by
Shinu
Top achievements
Rank 2
Share this question
or