Skip to content

Instantly share code, notes, and snippets.

View PilotBob's full-sized avatar

Bob Archer PilotBob

View GitHub Profile
HttpCookie myCookie = new HttpCookie("UserSettings");
myCookie.Expires = DateTime.Now.AddDays(-1d);
Response.Cookies.Add(myCookie);
// this code is in the DbContext so this is DbContext.
var objectContext = (this as IObjectContextAdapter).ObjectContext;
objectContext.CommandTimeout = csb.ConnectTimeout;
TranDetailExistsCommons = db.JobActivityEstimates.Any(e => e.JobKey == Key && db.TransCommons.Any(j => j.JobActivityEstimateKey == e.Key));
Error:
Unable to create a constant value of type 'Amsi.Model.eFinancials.TransCommon'. Only primitive types or enumeration types are supported in this context.
---
I still have no explaination of why this query not errors out after converting to DbContext... however, I have modified the query as follows. It returns the same results without getting the error:
Imports Microsoft.AspNet.SignalR
Public Class DocumentConverter
Inherits Hub
Public Sub ComplexProcess()
' Do the work here:
System.Threading.Thread.Sleep(2000)
Clients.Caller.AddProgress("Step 1 of 5 has completed.")
@PilotBob
PilotBob / gist:5506009
Last active December 16, 2015 22:19
Trying to use LINQ to XML to create an XElement that uses the correct rd namespace to it can be inserted into an existing RDL (sql server reporting service definition file) with the correct namespace aliases?
XNamespace rootNs = "http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition";
XNamespace rdNs = "http://schemas.microsoft.com/SQLServer/reporting/reportdesigner";
XElement _dataSource = new XElement("DataSource",
new XAttribute(XNamespace.Xmlns + "rd", rdNs),
new XAttribute("Name", "eFinancials_LOCAL"),
new XElement("ConnectionProperties", new XElement("DataProvider", "SQL"), new XElement("ConnectString", connectionString)),
new XElement(_rdns + "SecurityType", "DataBase"),
new XElement(_rdns + "DataSourceID", dataSourceId)
);
4/4/2013 3:58:08 PM: Object reference not set to an instance of an object.
at MadsKristensen.EditorExtensions.ProjectHelpers.GetRootFolder()
at MadsKristensen.EditorExtensions.ProjectHelpers.GetRootFolder()
var arrMemoFieldInfo = new List<SerializationInfo>();
foreach (ListItem li in arrMemoFields)
{
arrMemoFieldInfo.Add(new SerializationInfo() { Text = li.Text, Value = li.Value });
}
for /d /r . %%d in (bin,obj) do @if exist "%%d" rd /s/q "%%d"
pause
// The bottom row is empty clone the last row and append it to the table
var newrow$ = $("tr:visible:last", this).clone(true);
newrow$.find(":input")
// increment the index in the name of each input field so the are unique
.attr({
name: incrementName,
id: incrementId
})
// run the default method for each default
Innermost Exception:
System.Data.SqlClient.SqlExeception
{"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 52 - Unable to locate a LocalDB installation. Verify that SQL Server Express is properly installed and that the LocalDB feature is enabled.)"}
wrapped by:
System.Data.ProviderIncompatibleException
{"The provider did not return a ProviderManifestToken string."}
wrapped by: