Firebird and datasets

View: New views
5 Messages — Rating Filter:   Alert me  

Firebird and datasets

by Julio Saucedo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Hope that someone can help me, I am a newbie on .NET, and I'm involved
now developing an asp.net application with firebird. So, after reading
some tutorials, I started with the Dataset approach, so basically I
added a DataTable and a DataAdapter for a table to begin testings.
So, using some code that found in the ms documentation, i tried
something like this in a Page event:

      DatasetTableAdapters.TableAdapterTest TableAdapterTest;  /*
TableAdapter instance */
      Dataset.TestDataTable TestDataTable;   /* DataTable instance*/
      Dataset.TableRow Row;  /* Row instance */

      TableAdapterTest = new DatasetTableAdapters.TableAdapterTest();
      TestDataTable = new Dataset.TestDataTable();
      TestDataTable = TableAdapterTest.GetDataById(5);   /* A custom
query to filter by Id */
      Row = (Dataset.TableRow)TestDataTable.Rows[0];
      Row.FIELD = Row.FIELD + " _Testing";  /* Use of typed dataset */

      Row.AcceptChanges();
      TableAdapterTest.Update(TestDataTable);

So, basically I wanted to test if this code make changes in the
database, but it doesn't. I don't know what is missing, is necessary to
explicitly commit the transaction? if the answer is yes, how can i do that?
I don't have problems to read data (the GetData() and GetDataById()
works as expected).

Thanks in advance

Julio.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Re: Firebird and datasets

by Jiri Cincura :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Nov 8, 2009 at 06:13, Julio Saucedo <julio@...> wrote:
> I don't know what is missing, is necessary to
> explicitly commit the transaction?

If you didn't started it explicitly, then no. Did you provided update
command for the table adapter with proper parameters?

--
Jiri {x2} Cincura (CTO x2develop.com)
http://blog.cincura.net/ | http://www.ID3renamer.com

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Re: Firebird and datasets

by mike grace :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Julio,

Don't do AcceptChanges(). Just update the row and then do the .Update().

HTH


Mike

> Hi,
>
> Hope that someone can help me, I am a newbie on .NET, and I'm involved
> now developing an asp.net application with firebird. So, after reading
> some tutorials, I started with the Dataset approach, so basically I
> added a DataTable and a DataAdapter for a table to begin testings.
> So, using some code that found in the ms documentation, i tried
> something like this in a Page event:
> DatasetTableAdapters.TableAdapterTest TableAdapterTest;  /*
> TableAdapter instance */
> Dataset.TestDataTable TestDataTable;   /* DataTable instance*/
> Dataset.TableRow Row;  /* Row instance */
> TableAdapterTest = new DatasetTableAdapters.TableAdapterTest();
> TestDataTable = new Dataset.TestDataTable();
> TestDataTable = TableAdapterTest.GetDataById(5);   /* A custom
> query to filter by Id */
> Row = (Dataset.TableRow)TestDataTable.Rows[0];
> Row.FIELD = Row.FIELD + " _Testing";  /* Use of typed dataset */
> Row.AcceptChanges();
> TableAdapterTest.Update(TestDataTable);
> So, basically I wanted to test if this code make changes in the
> database, but it doesn't. I don't know what is missing, is necessary
> to
> explicitly commit the transaction? if the answer is yes, how can i do
> that?
> I don't have problems to read data (the GetData() and GetDataById()
> works as expected).
> Thanks in advance
>
> Julio.
>
> ----------------------------------------------------------------------
> --------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> trial. Simplify your report design, integration and deployment - and
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Firebird-net-provider mailing list
> Firebird-net-provider@...
> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Parent Message unknown Re: Firebird and datasets

by Julio Saucedo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks Mike, that was the trick :)

Julio

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Re: Firebird and datasets

by mike grace :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Julio,

No problem. The UpdateChanges() method tells the dataset that mods that been
done therefore the update method had nothing to do.

Mike

> Thanks Mike, that was the trick :)
>
> Julio
>
> ----------------------------------------------------------------------
> --------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> trial. Simplify your report design, integration and deployment - and
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Firebird-net-provider mailing list
> Firebird-net-provider@...
> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider