Thread View: borland.public.delphi.aspdotnet.general
4 messages
4 total messages
Started by Kev
Mon, 16 Jun 2008 10:36
BdpDataReader Replacement
Author: Kev
Date: Mon, 16 Jun 2008 10:36
Date: Mon, 16 Jun 2008 10:36
29 lines
1760 bytes
1760 bytes
Hi All
I have been using the following codes for database connection:
function TWebForm1.GetConnection: BdpConnection;
begin
Result := BdpConnection.Create;
Result.ConnectionOptions := ConfigurationManager.AppSettings.Get('ConnectionOptions');
Result.ConnectionString := ConfigurationManager.AppSettings.Get('ConnectionString');
end;
in the main function, I use the Reader to read record from the database
...
conn := GetConnection;
conn.Open;
BdpCmdUser := BdpCommand.Create;
BdpCmdUser.Connection := conn;
BdpCmdUser.CommandText := sql;
BdpCmdUser.Prepare;
reader := BdpCmdUser.ExecuteReader;
....
However, I believe that the BDP components are not advised to be used in RAD 2007. What is the best way to replace this and how? Also, is it not necessary to use the ConnectionOptions in the web.config? I was learning ASP.NET with Delphi 2005 and then upgraded to RAD 2007 and found out that quite a lot of things have been changed.
Many thanks
K
Re: BdpDataReader Replacement
Author: John Moshakis
Date: Mon, 16 Jun 2008 16:28
Date: Mon, 16 Jun 2008 16:28
40 lines
1931 bytes
1931 bytes
Kev wrote: > > However, I believe that the BDP components are not advised to be used > in RAD 2007. What is the best way to replace this and how? Also, is > it not necessary to use the ConnectionOptions in the web.config? I > was learning ASP.NET with Delphi 2005 and then upgraded to RAD 2007 > and found out that quite a lot of things have been changed. > > Many thanks > Hi Kev, dbexpress would be the replacement. You can add the Borland.Data.AdoDbxClient assembly and use the classes starting with TAdoDbx from the Borland.Data namespace. They should be a direct replacement for the bdp classes. I think a search and replace should work pretty well, except for some properties and methods. The classes all derive from the System.Data.Common namespace so as an alternative you could code against those instead. I have an example in codecentral which demonstrates this http://cc.codegear.com/Item/25030 If you look at the BookMarks.DataAccess project The web application uses some of the ASP.Net 2.0 controls as well. Cheers, John -- Blog: http://blog.moshine.com/
Re: BdpDataReader Replacement
Author: Kev
Date: Fri, 04 Jul 2008 08:52
Date: Fri, 04 Jul 2008 08:52
52 lines
2271 bytes
2271 bytes
Hi John I have looked at your example. Which assembly I need to include for using DBProviderHelper? I tried Borland.Data.AdoDbxClientProvider but it still says undeclared identifier when I use DBProviderHelper.GetProviderName. Thanks Kev "John Moshakis" <john@moshakis.com> wrote: >Kev wrote: > > >> >> However, I believe that the BDP components are not advised to be used >> in RAD 2007. What is the best way to replace this and how? Also, is >> it not necessary to use the ConnectionOptions in the web.config? I >> was learning ASP.NET with Delphi 2005 and then upgraded to RAD 2007 >> and found out that quite a lot of things have been changed. >> >> Many thanks >> > >Hi Kev, > >dbexpress would be the replacement. You can add the >Borland.Data.AdoDbxClient assembly and use the classes starting with >TAdoDbx from the Borland.Data namespace. > >They should be a direct replacement for the bdp classes. I think a >search and replace should work pretty well, except for some properties >and methods. > >The classes all derive from the System.Data.Common namespace so as an >alternative you could code against those instead. > >I have an example in codecentral which demonstrates this > >http://cc.codegear.com/Item/25030 > >If you look at the BookMarks.DataAccess project The web application >uses some of the ASP.Net 2.0 controls as well. > >Cheers, >John > > > >-- >Blog: http://blog.moshine.com/
Re: BdpDataReader Replacement
Author: John Moshakis
Date: Fri, 04 Jul 2008 14:48
Date: Fri, 04 Jul 2008 14:48
20 lines
1194 bytes
1194 bytes
Kev wrote: > > Hi John > > I have looked at your example. Which assembly I need to include for > using DBProviderHelper? I tried Borland.Data.AdoDbxClientProvider but > it still says undeclared identifier when I use > DBProviderHelper.GetProviderName. > It was part of the download in the BookMarks.Framework package, BookMarks.Framework.Data.DBProvider.pas Cheers, John -- Blog: http://blog.moshine.com/
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads