I am using Sqldatareader to fetch data from database. I have a storeprocedure where it returns records and have one of a parameter as output. The records are returning properly but when i try to access the output variable I get the value as empty.
I tried with dataTable,dataset and dataTableReader and I get the value of output parameter.
So I have added the output variable as a field in the query this way I am able to get the value. But I know this is not the best solution as I am appending the value to each row. So anybody out there can provide me a better solution so that I could approach
a better solution.
Please note that I dont want to use dataTable,dataset or dataTableReader.
Thanks in advance....
as.NET 2.0 VB
Regards,
Srinivas Ramanujan
Words offer the means to meaning, and for those who will listen, the enunciation of truth !!!!!
aresssriniva...
Contributor
3518 Points
838 Posts
Better Solution for Data Reader
May 22, 2009 05:56 AM|LINK
Hi all,
I am using Sqldatareader to fetch data from database. I have a storeprocedure where it returns records and have one of a parameter as output. The records are returning properly but when i try to access the output variable I get the value as empty. I tried with dataTable,dataset and dataTableReader and I get the value of output parameter.
So I have added the output variable as a field in the query this way I am able to get the value. But I know this is not the best solution as I am appending the value to each row. So anybody out there can provide me a better solution so that I could approach a better solution.
Please note that I dont want to use dataTable,dataset or dataTableReader.
Thanks in advance....
as.NET 2.0 VB
Srinivas Ramanujan
Words offer the means to meaning, and for those who will listen, the enunciation of truth !!!!!
aresssriniva...
Contributor
3518 Points
838 Posts
Re: Better Solution for Data Reader
May 23, 2009 08:06 AM|LINK
After searching on the net i found that its possible to get the value of the output parameter when using SqldataReader, here are the two ways i found:
- Have to close ur SqlDataReader
- reader.NextResult()
Srinivas Ramanujan
Words offer the means to meaning, and for those who will listen, the enunciation of truth !!!!!