why is Tables[0].TableName.ToString() = "Table"??

I have a stored procedure that returns up to 3 rows of data from a single table.

I have a data class method that calls this stored procedure and returns a DataSet.

However, when I call the method and attempt to return the table name, it returns "Table":

string tablename = TheClass.GetRecords().Tables[0].TableName.ToString();



Answer this question

why is Tables[0].TableName.ToString() = "Table"??

  • Darkdog

    That's most likly because your data class creates a dataset (real waste here, better to do a datatable if you are only returning one little lone table). Since it's a SP I'm assuming that it's not passing back a name and hence boom the default name of "Table", Though we have no idea what the code looks like for your SP call, are you using a data adapter  a Command class, have no idea.

    Joe

  • why is Tables[0].TableName.ToString() = "Table"??