FbCommandBuilder has problems with Calculated fields
----------------------------------------------------

                 Key: DNET-100
                 URL: http://tracker.firebirdsql.org/browse/DNET-100
             Project: .NET Data provider
          Issue Type: Bug
          Components: ADO.NET Provider
    Affects Versions: 2.1.0 RC 1
         Environment: .Net Framework 2.0
Windows Sever 2003
FB 2.0.1 SS
Visual Studio 2005 C#
            Reporter: Eduardo Gamboa
            Assignee: Carlos Guzman Alvarez


When I try to insert new rows using FbDataAdapter and FbCommandBuilder an 
exception is thrown when the table has calculated fields.(e.g)
/****************************************/
CREATE TABLE CONTACTS (
    FIRST_NAME  VARCHAR(32) NOT NULL,
    LAST_NAME   VARCHAR(32),
    FULL_NAME   COMPUTED BY (FIRST_NAME ||' '|| LAST_NAME)
);

/****************************************/
using System;
using System.Collections.Generic;
using System.Text;
using FirebirdSql.Data.FirebirdClient;
using System.Data;

namespace FBCommanBuilderTest
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                FbConnectionStringBuilder fbCsb = new 
FbConnectionStringBuilder();
                fbCsb.Dialect = 3;
                fbCsb.UserID = "SYSDBA";
                fbCsb.Password = "masterkey";
                fbCsb.Database = @"localhost:d:\my projects\firebird 
databases\test.fdb";
                FbConnection fbConn = new FbConnection(fbCsb.ConnectionString);
                fbConn.Open();
                string strCmd = "SELECT * FROM \"CONTACTS\"";
                FbDataAdapter fbDA = new FbDataAdapter(strCmd, fbConn);
                FbCommandBuilder fbCB = new FbCommandBuilder(fbDA);
                DataSet ds = new DataSet();
                fbDA.Fill(ds, "Contacts");
                object[] values = new object[3];
                values[0] = "EDUARDO";
                values[1] = "GAMBOA";
                values[2] = "DUMMY VALUE";
                ds.Tables["Contacts"].Rows.Add(values);
                fbDA.Update(ds.Tables["Contacts"]);
                fbConn.Close();
                Console.WriteLine("Ok.");
                Console.ReadLine();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error:");
                Console.WriteLine(ex.Message);
                Console.ReadLine();
            }
        }
    }
}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to