Hi,
I don’t get why my DataProcessor won’t update data. It is a pretty simple thing I’m trying to do and I have followed the examples as far as I can tell.
I have the following .NET DataConnector (grid_db_handler.ashx):
[code]
public override IdhtmlxConnector CreateConnector(HttpContext context)
{
string ds = context.Request.QueryString[“ds”];
string ljid = context.Request.QueryString[“ljid”];
connector = new dhtmlxGridConnector(
“SELECT Date, AppendixId, AccountType, AccountNumber, Description, Revenue, Expenses, Currency, VATCode FROM LedgerJournalTransactions WHERE (Dataset = '”+ ds +“’ AND LedgerJournalId = '”+ ljid +“') ORDER BY Id;”,
“Id”,
dhtmlxDatabaseAdapterType.SqlServer2005,
ConfigurationManager.ConnectionStrings[“DB”].ConnectionString);
connector.Request.TransactionMode = TransactionMode.PerRecord;
connector.Request.CustomSQLs.Add(
CustomSQLType.Update,
“UPDATE LedgerJournalTransactions SET Date = CONVERT(datetime, {date}), AppendixId = {appendix_id}, AccountType = {account_type}, AccountNumber = {account_number}, Description = {description}, Revenue = {revenue}, Expenses = {expenses}, Currency = {currency}, VATCode = {vat_code};”);
return connector;
}[/code]
And I have a Grid + DataProcessor as follows:
mygrid = new dhtmlXGridObject("gridbox");
mygrid.setImagePath("./dhtmlxgrid/codebase/imgs/");
mygrid.setHeader("Date, Appendix Id, Account Type, Account Number, Description, Revenue, Expenses, Currency, VAT Code", null, "");
mygrid.setColumnIds("date, appendix_id, account_type, account_number, description, revenue, expenses, currency, vat_code");
mygrid.setColTypes("ed, ed, ed, ed, ed, edn, edn, ed, ed");
mygrid.enableSmartRendering(true);
mygrid.init();
mygrid.load("grid_db_handler.ashx?ds=TKZ&ljid=F8EBF621-ECF3-44FD-A28B-578A2CC8E4FA");
var dp = new dataProcessor("grid_db_handler.ashx?ds=TKZ&ljid=F8EBF621-ECF3-44FD-A28B-578A2CC8E4FA");
dp.enableDataNames(true);
dp.enableDebug(true);
dp.init(mygrid);
The database table currently only has 1 row which is also loaded into the grid initially, but when I try to update any of the values in the grid, all the cell values turn red/bold which I believe means that there is an error/validation issue and that an update has not been performed.
I don’t know how to debug these components so I can’t really figure out what is wrong - Any help would be much appreciated both in regard to what could be wrong and also in regard to how to debug this - figuring out what is going wrong and why.