I am looking to convert a project from ADO to ADO.Net as the data connection method.
I decided to replace the ADO Recordsets with ADO.Net Datareaders, and went through the exercise of modifying the code.
Of course, when I went to run in, it died opening the second recordset because it said the SQL connection was already in use.
I went back and reread the documentation and found that only one DataReader can be used per SQL connection at a time.
Now this seems incredibly stupid to me. I have used ADO for years, and always have multiple nests of Recordset that are open based off data in another Recordset.
Although MS says in their documentaion that Datareaders are faaster than Datasets for simple data retrieval, it seem this object is basically worthless if you want to do nesting, unless you want to have a seperate SQL connection for each recordset, which also doesn' make any sense.
So, I am going to ask here before I bother trying to work with Datasets: Can you open multiple Datasets under one SQL connection at the same time?
I didn't find anything in the documentation indicating it couldn't b done, like with Datareaders, but I don't want to waste anymore time if I am going to discover it can't be done.
If MS has for some reason decided nesting and referencing one recordset from antoher is no longer used in programming, I guess I will have to stick with using the old ADO conneciton method.
I decided to replace the ADO Recordsets with ADO.Net Datareaders, and went through the exercise of modifying the code.
Of course, when I went to run in, it died opening the second recordset because it said the SQL connection was already in use.
I went back and reread the documentation and found that only one DataReader can be used per SQL connection at a time.
Now this seems incredibly stupid to me. I have used ADO for years, and always have multiple nests of Recordset that are open based off data in another Recordset.
Although MS says in their documentaion that Datareaders are faaster than Datasets for simple data retrieval, it seem this object is basically worthless if you want to do nesting, unless you want to have a seperate SQL connection for each recordset, which also doesn' make any sense.
So, I am going to ask here before I bother trying to work with Datasets: Can you open multiple Datasets under one SQL connection at the same time?
I didn't find anything in the documentation indicating it couldn't b done, like with Datareaders, but I don't want to waste anymore time if I am going to discover it can't be done.
If MS has for some reason decided nesting and referencing one recordset from antoher is no longer used in programming, I guess I will have to stick with using the old ADO conneciton method.