Hello
Please help.
I am a total novice with VWDE, and would be most obliged if you could overlook my general ignorance and help me with this issue.
I have a web form called Demo.aspx which incorporates a label (DateRange) that I would like to display the earliest and latest dates when a user had entered records into a table (Events) within a SQL Server Express 2005 database (EventCalendar).
I have prepared the following stored procedure intended to extract these dates:
CREATE PROCEDURE sp_DataDonationDateRange
@UserCode nchar(10),
@EarliestDate nchar(10) OUTPUT,
@LatestDate nchar(10) OUTPUT
AS
SET @EarliestDate = (SELECT MIN(CONVERT(nchar(10), dbo.Events.EventDate, 103))
FROM dbo.Events
WHERE dbo.Events.UserCode = @UserCode)
SET @LatestDate = (SELECT MAX(CONVERT(nchar(10), dbo.Events.EventDate, 103))
FROM dbo.Events
WHERE dbo.Events.ClientCode = @CliCode)
GO
(The procedure has been tested and appears to run well, returning the following row when @UserCode is set to a relevant value:
01/01/2003, 31/12/2004
)
I want to execute this procedure (on Page_Load) to return the first and last dates when a user had entered Event records by running the following against the SQL database (Demo), with the intention of displaying the following sequence within the DateRange label:
“You have entered records from “ + @EarliestDate + “to “ + @LatestDate.”
The connection that I have set up in the Database Explorer is called “DemoConnectionString”.
I’ve scanned innumerable sources but with no success. No articles appear to encapsulate all of the tasks involved in one place, and I am extremely confused as to how best to approach this.
I would be very grateful if anyone could provide me with the correct vb code to apply to the form’s Page_Load event, or if they could direct me to an appropriate article on the web.
Many thanks in advance.
Regards
DixieDean
Please help.
I am a total novice with VWDE, and would be most obliged if you could overlook my general ignorance and help me with this issue.
I have a web form called Demo.aspx which incorporates a label (DateRange) that I would like to display the earliest and latest dates when a user had entered records into a table (Events) within a SQL Server Express 2005 database (EventCalendar).
I have prepared the following stored procedure intended to extract these dates:
CREATE PROCEDURE sp_DataDonationDateRange
@UserCode nchar(10),
@EarliestDate nchar(10) OUTPUT,
@LatestDate nchar(10) OUTPUT
AS
SET @EarliestDate = (SELECT MIN(CONVERT(nchar(10), dbo.Events.EventDate, 103))
FROM dbo.Events
WHERE dbo.Events.UserCode = @UserCode)
SET @LatestDate = (SELECT MAX(CONVERT(nchar(10), dbo.Events.EventDate, 103))
FROM dbo.Events
WHERE dbo.Events.ClientCode = @CliCode)
GO
(The procedure has been tested and appears to run well, returning the following row when @UserCode is set to a relevant value:
01/01/2003, 31/12/2004
)
I want to execute this procedure (on Page_Load) to return the first and last dates when a user had entered Event records by running the following against the SQL database (Demo), with the intention of displaying the following sequence within the DateRange label:
“You have entered records from “ + @EarliestDate + “to “ + @LatestDate.”
The connection that I have set up in the Database Explorer is called “DemoConnectionString”.
I’ve scanned innumerable sources but with no success. No articles appear to encapsulate all of the tasks involved in one place, and I am extremely confused as to how best to approach this.
I would be very grateful if anyone could provide me with the correct vb code to apply to the form’s Page_Load event, or if they could direct me to an appropriate article on the web.
Many thanks in advance.
Regards
DixieDean