Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB Connectivity » View Thread |
Messages 1 to 5 of 5 total |
Problem executing INSERT statement |
Thu, May 26 2011 8:51 AM | Permanent Link |
Jan | Hi!
I'm just trying to execute a simple INSERT statement: using (Elevate.ElevateDB.Data.EDBCommand cmd = new Elevate.ElevateDB.Data.EDBCommand("", Conn)) { Conn.ChangeDatabase("MyDatabase"); cmd.ParamCheck = true; cmd.CommandText = "INSERT INTO Doc(DocName, Extension) VALUES(:DocName, :Extension)"; cmd.Parameters["DocName"].Value = "blah"; cmd.Parameters["Extension"].Value = "bluh"; cmd.ExecuteNonQuery(); } I'm getting a EDBException (inner ex. is a NullReferenceException). Stack trace: bei Elevate.ElevateDB.Data.EDBCommand.Execute() bei Elevate.ElevateDB.Data.EDBCommand.ExecuteNonQuery() bei ElevateDB.Form1.DocTestBtn_Click(Object sender, EventArgs e) in... Do i have to set DbType or Size to the automatically created EDBParameter objects? Regards an thanks, Jan |
Thu, May 26 2011 9:07 AM | Permanent Link |
Chris Holland SEC Solutions Ltd. Team Elevate | Hi Jan,
I believe that the ODBCConnection has to be Open() before you can use the ChangeDatabase() function. Chris Holland [Team Elevate] ---------------------------------------------------------------------- Jan wrote: Hi! I'm just trying to execute a simple INSERT statement: using (Elevate.ElevateDB.Data.EDBCommand cmd = new Elevate.ElevateDB.Data.EDBCommand("", Conn)) { Conn.ChangeDatabase("MyDatabase"); cmd.ParamCheck = true; cmd.CommandText = "INSERT INTO Doc(DocName, Extension) VALUES(:DocName, :Extension)"; cmd.Parameters["DocName"].Value = "blah"; cmd.Parameters["Extension"].Value = "bluh"; cmd.ExecuteNonQuery(); } I'm getting a EDBException (inner ex. is a NullReferenceException). Stack trace: bei Elevate.ElevateDB.Data.EDBCommand.Execute() bei Elevate.ElevateDB.Data.EDBCommand.ExecuteNonQuery() bei ElevateDB.Form1.DocTestBtn_Click(Object sender, EventArgs e) in... Do i have to set DbType or Size to the automatically created EDBParameter objects? Regards an thanks, Jan |
Thu, May 26 2011 10:26 AM | Permanent Link |
Jan | Hi Chris!
> I believe that the ODBCConnection has to be Open() > before you can use the ChangeDatabase() function. The connection (ADO.NET) is open an i can execute SELECT statements. Apart from that the driver should not throw a NullReferenceException if the connecion is closed. Regards, Jan |
Thu, May 26 2011 10:51 AM | Permanent Link |
Jan | Hi!
I have just realized, that the INSERT statement was executed. A new row was inserted properly into the table. So the exception is thrown after the execution... Regards, Jan |
Tue, May 31 2011 2:56 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Jan,
<< I'm getting a EDBException (inner ex. is a NullReferenceException). >> This was fixed in 2.05 B8: http://www.elevatesoft.com/incident?action=viewrep&category=edb&release=2.05&incident=3455 -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Thursday, May 23, 2024 at 07:54 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |