How to use inline Visual Basic .Net code?
<%
'Do something here, for instance System.IO.File.Copy("c:\DailyLogs\*.log", "c:\AllLogs")
Return ""
%>
SELECT TOP 100 * FROM <1>
WHERE date >= '<% RETURN DateTime.Today.AddDays(-7).ToString("yyyy-MM-dd")%>' -- last week
The resulting query from this sample would be:
SELEC TOP 100 * FROM <1> WHERE date >= '2011-10-01' -- last week
This query will prompt for input of EventID:
select top 100 * from Application where EventID=<% return Microsoft.VisualBasic.Interaction.InputBox("Please enter Event ID","Event ID","1053") %>