SqlDataReader.Depth not working?

  • Thread starter Thread starter Nigil LaVey
  • Start date Start date
N

Nigil LaVey

hi guys... does anyone know the reason why SqlDataReader.Depth is not
working.. or is there any work around on it?
it just keep return 0 value..

sqlCmd="select * from MyTable()";
sqlReader=sqlCmd.ExecuteScalar();
Response.Write(sqlReader.Depth);

please advise,
Nigil Chua
 
From the documentation : "The outermost table has a depth of zero. The .NET
Framework Data Provider for SQL Server does not support nesting and always
returns zero."

Anyway I don't really see whay you would expect here as you select from a
single table using ExecuteScalar ?? If you want the row count you could use
"select count(*)..."

Patrice
 
It's noet used with the SqlDataReader, only with the XmlDataReader which
works with hierarchical data (XML).
 
Back
Top