<cc1:LinqServerModeDataSource ID="LinqServerModeDataSourceMain" runat="server" ContextTypeName="RESREPRICER.Web.DataClassesTransactionsDataContext" TableName="viewTransactions" OnSelecting="LinqServerModeDataSourceMain_Selecting"/>I need to filter that data based on a session variable so that whoever is logged in can see only their own data. Note that if the user logged in is an administrator, they should be able to see all data.
protected void LinqServerModeDataSourceMain_Selecting(object sender, DevExpress.Data.Linq.LinqServerModeDataSourceSelectEventArgs e) { //DataClassesDataContext db = new DataClassesDataContext(); RESREPRICER.Web.DataClassesTransactionsDataContext db = new DataClassesTransactionsDataContext(); string OfficeID = (String)Session["OID"]; var data = (from viewTransactions in db.viewTransactions where viewTransactions.OID == OfficeID select GUID, DateImported, OID, PNR, StoredFare, RMQ, LowerFare, (StoredFare - LowerFare) * ISNULL(Passengers, 1) AS FareDiff, Timestamp, DATENAME(Month, Timestamp) AS DatedMonth, DATEPART(yyyy, Timestamp) AS DatedYear, DATENAME(quarter, Timestamp) AS DatedQuarter, DATENAME(Day, Timestamp) AS DatedDay, DATENAME(weekday, Timestamp) AS DatedWeekday, REPLACE(CONVERT(CHAR(5), Timestamp, 108), ':', '') AS DatedTime, MFRA, ScriptResult, AgentID, PNRStatus, Segments, Currency ,Passengers); e.QueryableSource = data; }I am getting these errors (ignoring the other errors that are due to my SQL syntax):