Hi.
I am just starting to migrate to ASP.NET from ASP and just need a little help PLZ, with the WHERE STATEMENT IN SQL QUERY. Been looking everywhere, forums, search, etc. Could not find anything.
All works well in ASP Page, and All works well in ASP.NET Page except I DO NOT KNOW how to make it so that it only displays the records from a particular site, or week, or whatever the case may be.
In ASP, I would do the statement like this:
<%
Sitenum = Request.QueryString("Sitenum"
Set RS = Server.CreateObject("ADODB.Recordset"
SqlString = "SELECT SUM(TicketCount) as ticketsum, Tickets.Technician, Technicians.Technician as Technician_Name, Tickets.Site, Sites.SiteName as Site_Name, Tickets.Week "
SqlString = SqlString & " FROM (Tickets INNER JOIN Technicians ON Tickets.Technician = Technicians.TechnicianID) INNER JOIN Sites ON Tickets.Site = Sites.SiteID"
SqlString = SqlString & " WHERE Tickets.Site = '" & Sitenum & "'"
Set RS = objConn.Execute ( SqlString )
%>
In ASP.NET I HAVE THIS:
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MMataSet
id="ListingTickets"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_Reports" %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_Reports" %>'
CommandText='<%# "SELECT Tickets.TicketCount, Tickets.Week, Tickets.Site, Tickets.Technician, Sites.SiteName as Site_Name, Technicians.Technician as Tech_Name FROM Tickets INNER JOIN Technicians ON Tickets.Technician = Technicians.TechnicianID INNER JOIN Sites ON Tickets.Site = Sites.SiteID WHERE this is where I need help" %>'
PageSize="10"
Debug="true"
>
</MMataSet>
<MMageBind runat="server" PostBackBind="true" />
And how do I bring in the aspx page the requeststring?
In ASP I do:
ListTickets.asp?Sitenum=1 or 2 or whatever
and the ASP Page would have:
Sitenum = Request.QueryString("Sitenum"
Now in ASP.NET would be what:
Thank You Very Much For Your Help.
I am just starting to migrate to ASP.NET from ASP and just need a little help PLZ, with the WHERE STATEMENT IN SQL QUERY. Been looking everywhere, forums, search, etc. Could not find anything.
All works well in ASP Page, and All works well in ASP.NET Page except I DO NOT KNOW how to make it so that it only displays the records from a particular site, or week, or whatever the case may be.
In ASP, I would do the statement like this:
<%
Sitenum = Request.QueryString("Sitenum"
Set RS = Server.CreateObject("ADODB.Recordset"
SqlString = "SELECT SUM(TicketCount) as ticketsum, Tickets.Technician, Technicians.Technician as Technician_Name, Tickets.Site, Sites.SiteName as Site_Name, Tickets.Week "
SqlString = SqlString & " FROM (Tickets INNER JOIN Technicians ON Tickets.Technician = Technicians.TechnicianID) INNER JOIN Sites ON Tickets.Site = Sites.SiteID"
SqlString = SqlString & " WHERE Tickets.Site = '" & Sitenum & "'"
Set RS = objConn.Execute ( SqlString )
%>
In ASP.NET I HAVE THIS:
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MMataSet
id="ListingTickets"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_Reports" %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_Reports" %>'
CommandText='<%# "SELECT Tickets.TicketCount, Tickets.Week, Tickets.Site, Tickets.Technician, Sites.SiteName as Site_Name, Technicians.Technician as Tech_Name FROM Tickets INNER JOIN Technicians ON Tickets.Technician = Technicians.TechnicianID INNER JOIN Sites ON Tickets.Site = Sites.SiteID WHERE this is where I need help" %>'
PageSize="10"
Debug="true"
>
</MMataSet>
<MMageBind runat="server" PostBackBind="true" />
And how do I bring in the aspx page the requeststring?
In ASP I do:
ListTickets.asp?Sitenum=1 or 2 or whatever
and the ASP Page would have:
Sitenum = Request.QueryString("Sitenum"
Now in ASP.NET would be what:
Thank You Very Much For Your Help.