I don't see that code anywhere. So that must be your code, right? Did you generate it by inheriting your class from TableBase? And then you're trying to use that generated code? I would also have to see the schema for your table to debug that issue. Make sure capitalization is correct. Are you sure it's not AnestheticMedsNum, for example? (with an s).
using System;
using System.Collections;
using OpenDentBusiness;
namespace Anesthesia
{
/// <summary>The names and inventory counts of all scheduled anesthetic medications stored on premises </summary>
[Serializable()]
public class AnesthMedsInventory : TableBase {
[CrudColumn(IsPriKey = true)]
///<summary>Primary Key</summary>
public long AnestheticMedNum;
public string AnesthMedName;
public string AnesthHowSupplied;
public string QtyOnHand;
public string DEASchedule;
public AnesthMedsInventory Copy()
{
return (AnesthMedsInventory)this.MemberwiseClone();
}
}
}
I don't see any typos.
How are you generating your CRUD templates?
Cheers,
Bill Starck, DDS Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Almost there. Now, I'd have to see the code that created the DataTable as well as the actual database schema. The database schema is not the one you just provided. It's the one generated by MySQL. Here's an example from another table:
CREATE TABLE `covcat` (
`CovCatNum` bigint(20) NOT NULL auto_increment,
`Description` varchar(50) default '',
`DefaultPercent` tinyint(3) NOT NULL default '0',
`CovOrder` tinyint(3) unsigned NOT NULL default '0',
`IsHidden` tinyint(1) unsigned NOT NULL default '0',
`EbenefitCat` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`CovCatNum`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
We generate our crud files by running the crud project in the solution. But I wouldn't expect you to do that. We only gain efficiency because of the scale.
Well, if you're passing in a DataTable, it must have come from a query somewhere. I would need to see that code to see why that column was not part of that table.
Sorry I couldn't be more direct help. This sort of thing is complicated to do in a forum.
I was using a one of the GetOne methods similar to those found in any one Crud classes.
Turns out I was using a DataCore.NonQ(command) call when I should have been using a DataCore.GetScalar(command) call in another method. So the DataTable was being fed some null values, instead of the correct quantities. Hence the bomb.
Thanks again for your help...
Cheers,
Bill Starck, DDS Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA