🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.aspdotnet.components.using
2 messages
2 total messages Started by Peter Matulich Tue, 27 Dec 2005 20:23
DBImage
#151
Author: Peter Matulich
Date: Tue, 27 Dec 2005 20:23
28 lines
2053 bytes
I have a SQL table with Images  and Captions and I want to put together sort 
of a slide show.

I am using BdpConnection,BdpDataAdapter ,a generated typed Dataset and 
DBWebDataSource.
I have a DBWebLabel as well as Label off the WebControls.
The DbImage is linked to the Table called Images, Column called image and 
the DbDatasource is set to DBWebDataSource1

The OnClick event for Connect is
  BdpConnection1.Open;
  BdpDataAdapter1.Active := True;
  DBWebImage1.DataBind;

The OnClick even for the next button fires
 BdpDataAdapter1.Active := True;
 Label1.Text :=   Dataset1.Images.Item[2].caption;

Here are my questions, bare with me if they are fairly obvious.
1) When the Connect Button is fired and the Page is loaded does the 
BdpDataAdapter1 get deactivated?
2) The 'connected' webpage is rendered the databound controls fill with the 
first rows data. How can I get to the next record, as you know TDataset 
allowed for First,Next, Prior, Last. etc.  I can get my the next record's 
caption in the Label1.Text using Dataset1.Images.Item[2].caption, but how 
would I load the DBWebImage?

Peter
Re: DBImage
#152
Author: Peter Matulich
Date: Tue, 27 Dec 2005 21:56
66 lines
3347 bytes
I learned how to change Records reading a post by Nick Hodges.
I need to add the following next button on click event.
var
psm:IDBPostStateManager;
begin
  BdpDataAdapter1.Active := True;
 //global var
   if myrec  = (Dataset11.Photos.Rows.Count-1) then
   begin
     Label1.text := 'No More Images' ;
     btnNext.enabled := False;
   end else
   begin
     inc(myrec);
     psm := dbWebDataSource1 as IDBPostStateManager;
     psm.SetCurrentRow(self,'Images',myrec );
   end;
end;

I try not to use data aware controls as often as possible. How can I load 
the image from an SQL Blob field to an Image Component on the WebControls 
Palette?

I also have not been able to track down a CurrentRow but I guess it would 
make sense that I would have to manage the current row myself, as I have 
needed to do this in a similar project using javascript.

Is there a way to keep the Adapter Active? for an entire session?

Can you or anyone recommend a good book for ASP.NET related to Delphi?


"Peter Matulich" <peterm@accumedic.com> wrote in message 
news:43b1a25d$1@newsgroups.borland.com...
>I have a SQL table with Images  and Captions and I want to put together 
>sort of a slide show.
>
> I am using BdpConnection,BdpDataAdapter ,a generated typed Dataset and 
> DBWebDataSource.
> I have a DBWebLabel as well as Label off the WebControls.
> The DbImage is linked to the Table called Images, Column called image and 
> the DbDatasource is set to DBWebDataSource1
>
> The OnClick event for Connect is
>  BdpConnection1.Open;
>  BdpDataAdapter1.Active := True;
>  DBWebImage1.DataBind;
>
> The OnClick even for the next button fires
> BdpDataAdapter1.Active := True;
> Label1.Text :=   Dataset1.Images.Item[2].caption;
>
> Here are my questions, bare with me if they are fairly obvious.
> 1) When the Connect Button is fired and the Page is loaded does the 
> BdpDataAdapter1 get deactivated?
> 2) The 'connected' webpage is rendered the databound controls fill with 
> the first rows data. How can I get to the next record, as you know 
> TDataset allowed for First,Next, Prior, Last. etc.  I can get my the next 
> record's caption in the Label1.Text using Dataset1.Images.Item[2].caption, 
> but how would I load the DBWebImage?
>
> Peter
>
>
>
> 
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