I have a database table where columns are in multiple schemas. Example:
SomeTable SomeSchema.Column1 SomeSchema.Column2 AnotherSchema.ColumnA AnotherSchema.ColumnB
I have code using a DataTable.Rows[r][c].ToString()
syntax and it looks like only the Column1
or ColumnA
part is being returned. I need to get the full name SomeSchema.Column1
as right now it seems the code is throwing a Sql Exception with Column1 not found. I'm assuming that if I can reference it as SomeSchema.Column1
that this will correct the exception. Can I get this using a DataTable
or DataColumn
or is there another approach I need to take for this? Any ideas? I have searched Google and this site with such keywords as "C# datatable datacolumn schema table dbo" and have not had much luck.