Is there a VB.NET equivalent (More of a work-around) to the C# using keyword in the ability to return execution to the original routine. I know that VB.NET does not have this ability, but wondering what is recommended for VB.NET.
For example if I want to return a DataReader and once I'm done looping through the reader, return execution back to the method which gave me the reader object:
regards,
Brian
The problem with doing something right the first time is that nobody appreciates how difficult it was.
For example if I want to return a DataReader and once I'm done looping through the reader, return execution back to the method which gave me the reader object:
Code:
public static OleDbDataReader LendReader(string sql)
{
using (OleDbConnection conn = CreateConnection())
{
conn.Open()
OleDbCommand c = new OleDbCommand(sql,conn);
OleDbDataAdapter r = c.ExecuteReader();
return r;
}
}
regards,
Brian
The problem with doing something right the first time is that nobody appreciates how difficult it was.