G
Guest
Hi All,
I'm trying to make the following code not throw an exception ... (C#, .Net
2.0)
System.Data.DataTable tab = new System.Data.DataTable();
System.Data.DataColumn col = new System.Data.DataColumn("one",
typeof( System.Data.SqlTypes.SqlString ) ) ;
tab.Columns.Add(col);
System.Data.UniqueConstraint unique = new
System.Data.UniqueConstraint(col);
tab.Constraints.Add(unique);
tab.Rows.Add("hello");
tab.Rows.Add("hello ");
tab.Rows.Add(" hello ");
The three strings are unique .. note the trailing spaces.
Exception is thrown on the second add.
Is it possible to make a column not trim the spaces for comparison purposes ?
Any ideas ?
Thanks,
Richard
I'm trying to make the following code not throw an exception ... (C#, .Net
2.0)
System.Data.DataTable tab = new System.Data.DataTable();
System.Data.DataColumn col = new System.Data.DataColumn("one",
typeof( System.Data.SqlTypes.SqlString ) ) ;
tab.Columns.Add(col);
System.Data.UniqueConstraint unique = new
System.Data.UniqueConstraint(col);
tab.Constraints.Add(unique);
tab.Rows.Add("hello");
tab.Rows.Add("hello ");
tab.Rows.Add(" hello ");
The three strings are unique .. note the trailing spaces.
Exception is thrown on the second add.
Is it possible to make a column not trim the spaces for comparison purposes ?
Any ideas ?
Thanks,
Richard