Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Column argument cannot be null, Parameter name: column from Relations.Add

$
0
0

Hello,

I'm developing a C#, Visual Studio 2015 Pro Windows Form program with a master/detail DataGridView in a SplitContainer.

When I execute this Relation.Add in a Try/Catch:

data.Relations.Add(dataGroups[dgIndex].dataRelationName, data.Tables[1].Columns[dataGroups[dgIndex].parentColumnName], data.Tables[0].Columns[dataGroups[dgIndex].childColumnName], false);

It catches the following error:

This is the SQL statement that it is using to extract the data from the tables:

"select * From Category", "select * From Product_Category_Mapping"

That same SQL Statement works fine in a SQL Server Management Studio Query.

I can't figure out how to resolve it.  I have tried Google searches and MSDN searches.  I have about six other table extracts for other tables that work without a problem using the same code.

Does anyone know what could possibly be wrong with this relation?

Thanks,
Tony


Stop The World, I want To Get Off! ........... Life Isn't About Waiting For The Storm To Pass ... It's About Learning To Dance In The Rain.






Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>