Hi guys I am trying to create a code that allows me to take either first name or last name or both and display accordingly on the gridview.. Much help is appreciated
viewrecords.aspx
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="~/App_Data/JABILMCALLEN.mdb"
SelectCommand="SELECT Employees.Name, TrainingDocuments.ReferenceDocument, TrainingDocuments.Description, Certifications.[Started Training], Certifications.[Ended Training], Certifications.TrainedBy, Certifications.Approved
FROM TrainingDocuments INNER JOIN (Employees INNER JOIN Certifications ON Employees.EmployeeID = Certifications.EmployeeID) ON TrainingDocuments.TrainingDocID = Certifications.TrainingDocID
WHERE (((Certifications.Approved)=Yes) AND ((Certifications.TrainingDocID)=[TrainingDocuments].[TrainingDocID]) AND ((Employees.Name)=@nameVar));">
<SelectParameters>
<asp:QueryStringParameter Name="Name" QueryStringField="Name" Type="String" />
</SelectParameters>
</asp:AccessDataSource>
code behind
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim nameVar As String = Request.QueryString("Name")
If nameVar = "" Then
Response.Redirect("Main.aspx") 'Handle empty submissions
End If
End Sub