Wiered problem with AddColumn:

I have writen the following method:


privatestatic DataColumn AddColumn3( DataTable dt, DataColumn dc,string name, Type type,string label,string def )
{
dc =new DataColumn(name, type);
dc.Caption = label;
dc.DefaultValue = def;
dt.Columns.Add(dc);
return dc;
}


<br><br>
Now this method works perfectly but when I use a different constructor for the Datacolumn like this:


privatestatic DataColumn AddColumn3( DataTable dt, DataColumn dc,string name, Type type,string label,string def )
{
dc =new DataColumn(name, type,label);
dc.DefaultValue = def;
dt.Columns.Add(dc);
return dc;
}


<br><br>
It crash my program with the following error:

An unhandled exception of type 'System.Data.EvaluateException' occurred in system.data.dll
Additional information: Cannot find column [FName].

Can anyone shed some light on this please?
[2004 byte] By [daat99] at [2007-12-16]
# 1
If you can still reproduce this, post a bug on the Microsoft Product Feedback Center.
DavidM.Kean-MSFT at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# General...