Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy can't I save a database transaction using SubSonic?
    text
    copied!<p>I have a table called jobs and I can get data out of the table with no problems but saving is causing issues. Here is the code and the error: </p> <pre><code> Job job = new Job(JobId); job.Name = txtName.Text; job.SimsCustCode = txtSimsCustCode.Text; job.Mode = cboMode.Text; job.Interval = Convert.ToInt32(nudInterval.Text); job.Enabled = Convert.ToBoolean(chkEnabled.Checked); job.SourceHost = txtSourceHostName.Text; job.SourceType = cboSourceType.Text; job.SourceUsername = txtSourceUsername.Text; job.SourcePassword = txtSourcePassword.Text; job.SourceDirectory = txtSourceDirectory.Text; job.SourceIgnoreExtension = txtSourceIgnoreExtension.Text; job.TargetHost = txtTargetHostName.Text; job.TargetType = cboTargetType.Text; job.TargetUsername = txtTargetUsername.Text; job.TargetPassword = txtTargetPassword.Text; job.TargetDirectory = txtTargetDirectory.Text; job.TargetTempExtension = txtTargetTempExtension.Text; job.Save(); </code></pre> <p>Here is the error: </p> <pre><code>A first chance exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval) VALUES('adf','adsf','inbound','ftp','','','','','','ftp','','','','','' at line 1 </code></pre> <p>To clarify, if I edit an existing job it works fine, it's only saving new jobs that fails.</p> <p>Here is the schema: </p> <p>Table Create Table </p> <hr> <p>jobs CREATE TABLE <code>jobs</code> (<br> <code>id</code> int(11) NOT NULL auto_increment,<br> <code>name</code> varchar(100) NOT NULL,<br> <code>sims_cust_code</code> varchar(10) NOT NULL,<br> <code>mode</code> varchar(10) NOT NULL,<br> <code>source_type</code> varchar(10) NOT NULL,<br> <code>source_host</code> varchar(100) default NULL,<br> <code>source_username</code> varchar(50) default NULL,<br> <code>source_password</code> varchar(50) default NULL,<br> <code>source_directory</code> varchar(100) default NULL,<br> <code>source_ignore_extension</code> varchar(10) default NULL,<br> <code>target_type</code> varchar(10) NOT NULL,<br> <code>target_host</code> varchar(100) default NULL,<br> <code>target_username</code> varchar(50) default NULL,<br> <code>target_password</code> varchar(50) default NULL,<br> <code>target_directory</code> varchar(100) default NULL,<br> <code>target_temp_extension</code> varchar(10) default NULL,<br> <code>enabled</code> tinyint(1) NOT NULL,<br> <code>interval</code> int(11) NOT NULL,<br> PRIMARY KEY (<code>id</code>)<br> ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload