Wednesday, December 23, 2015
url in menus
will not be there for categories or products - this is system generated
Wednesday, December 9, 2015
The worker process for app pool 'IISExpressAppPool', PID='6556', failed to initialize the http.sys communication when asked to start processing http requests and therefore will be considered ill by W3SVC and terminated. The data field contains the error number
wierd #$%^ I had to restart vs and iisexpress
Wednesday, November 25, 2015
for ridiculous cshtml build errors
build with page closed
Tuesday, November 24, 2015
making the workspace server
in tfs improved performance muchly - we have large projects
Friday, November 20, 2015
Wednesday, November 18, 2015
Tuesday, November 17, 2015
Friday, November 13, 2015
when updating dll in modules on orchard
you may have to update the dependency folder even if you did an app pool reset
Wednesday, November 4, 2015
latest changes sp's
SELECT name, create_date, modify_date
FROM sys.objects
WHERE type = 'P'
order by modify_date desc
FROM sys.objects
WHERE type = 'P'
order by modify_date desc
Wednesday, October 28, 2015
There was no endpoint listening at
oh my. I didn't check the address - it was missing ;(
Tuesday, October 27, 2015
Could not load file or assembly Microsoft.SqlServer.SqlClrProvider
how to view the GAC as files - allowing copying etc
Thursday, October 22, 2015
order by on binary cast as bigint
order by cast(sequence_no as bigint)
will not order by correctly
will not order by correctly
Monday, October 19, 2015
poweliks virus
addressed here
actually, in my case I had a mp4 I had downloaded from youtube through a downloading site.
the mp4 itself was doing the trouble - so I went in safe mode and deleted the file - I even had to clear recycle bin
now it looks ok
actually, in my case I had a mp4 I had downloaded from youtube through a downloading site.
the mp4 itself was doing the trouble - so I went in safe mode and deleted the file - I even had to clear recycle bin
now it looks ok
Thursday, October 15, 2015
Friday, October 9, 2015
Thursday, October 8, 2015
change sql profiler defaults
Trying to pass a table-valued parameter with 11 column(s) where the corresponding user-defined table type requires 12 column(s).
select tt.name,count( c.name) from sys.table_types tt
inner join sys.columns c on c.object_id = tt.type_table_object_id
group by tt.name
inner join sys.columns c on c.object_id = tt.type_table_object_id
group by tt.name
Monday, September 21, 2015
sql server profiler woes
i couldnt see anything with sp - stmt start - i only saw with rpc completed
Thursday, September 17, 2015
http 404 error on wcf rest service httpget
i was getting because of the length of the querystring
Friday, September 11, 2015
Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.
just means a timeout
Tuesday, August 25, 2015
sc vs installutil
i forgot how troublesome installutil is - i had a name with "-" and it wasnt coming up right so I used sc - way to go
Monday, July 20, 2015
bizarre NullLogger behaviour
i was using NullLogger in orchard and I needed to do this
public MenuProvider(UrlHelper urlHelper, IOrchardServices services)
{
_urlHelper = urlHelper;
_services = services;
Logger = NullLogger.Instance;
}
instead of just referring to NullLogger.Instance.Log("blah")
Thursday, July 9, 2015
View dependencies
in ssms is not always correct because it depends on sysdepends
this is more accurate
select t.name as TableWithForeignKey, fk.constraint_column_id as FK_PartNo , c.name as ForeignKeyColumn
from sys.foreign_key_columns as fk
inner join sys.tables as t on fk.parent_object_id = t.object_id
inner join sys.columns as c on fk.parent_object_id = c.object_id and fk.parent_column_id = c.column_id
where fk.referenced_object_id = (select object_id from sys.tables where name = 'BLAH')
order by TableWithForeignKey, FK_PartNo
this is more accurate
select t.name as TableWithForeignKey, fk.constraint_column_id as FK_PartNo , c.name as ForeignKeyColumn
from sys.foreign_key_columns as fk
inner join sys.tables as t on fk.parent_object_id = t.object_id
inner join sys.columns as c on fk.parent_object_id = c.object_id and fk.parent_column_id = c.column_id
where fk.referenced_object_id = (select object_id from sys.tables where name = 'BLAH')
order by TableWithForeignKey, FK_PartNo
cache: false in $.ajax( calls
work because they add the following request header
- Cache-Control:no-cache
Wednesday, July 8, 2015
De-serialization issue checklist
make sure
1) all base classes and properties are properly adorned
1) all base classes and properties are properly adorned
[DataContract]
[Serializable]
2) base class and property may need also knowntype
[KnownType(typeof(BlahBase))]
public class Blah: BlahBase
in order to get type name from collection
for Serialization with distributed caching
[DataContract]
was not enough
i needed
[Serializable]
was not enough
i needed
[Serializable]
Tuesday, June 23, 2015
The type arguments for method cannot be inferred from the usage
means you need to be specific in the method call
.getBlahs<Collection<Blah>>()
.getBlahs<Collection<Blah>>()
The type must be a reference type in order to use it as parameter 'T' in the generic type or method
usually just means you need to add where T : class
Thursday, June 18, 2015
JavaScript filter on an array
returns an array
Wednesday, June 17, 2015
Thursday, May 28, 2015
for missing taskbar in windows
for example after installing software ->
open task manager->start explorer
open task manager->start explorer
Thursday, May 21, 2015
mapping fake routes in MVC
routes.MapRoute(
"Boris",
"Boris/Show",
new
{
controller = "Herby",
action = "Index"
}
);
"Boris",
"Boris/Show",
new
{
controller = "Herby",
action = "Index"
}
);
if your'e lazy and have simple "and"s separated by "or"s
then neat "and"s and or"s work like parentheses
select * from
(
select 1 a , 'hi there' b , 102 c
union
select 2 a , 'hi there' b , 103 c
union
select 10 a , 'hi there' b , 103 c
union
select 9 a , 'hi there' b , 103 c
union
select 8 a , 'by there' b , 103 c
union
select 7 a , 'by there' b , 103 c
union
select 6 a , 'by there' b , 10 c
) as main
where b = 'by there'
and a=6
or a > 1
and a < 4
and b = 'hi there'
or a = 10
and b = 'hi there'
Simple MVC Filter
public class TestFilter : ActionFilterAttribute
{
public override void OnActionExecuted(ActionExecutedContext
filterContext)
{
base.OnActionExecuted(filterContext);
System.IO.File.AppendAllText(@"c:\log.txt", string.Format("{0}\r\n",
filterContext.RequestContext.HttpContext.Request.Url.ToString()));
}
}
In global.asax:
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
WebApiConfig.Register(GlobalConfiguration.Configuration);
GlobalFilters.Filters.Add(new TestFilter());
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
Friday, May 15, 2015
Could not find default endpoint element that references contract
the contract was wrong ;(
Wednesday, May 13, 2015
basicHttpBinding cannot handle
application/octet so streams are a problem
Tuesday, April 28, 2015
file schema could not be identified because of an i/o error
i got this trying to read a _Traces.svclog with too many viewers open - wierd
Thursday, April 16, 2015
Wednesday, March 25, 2015
top variable needs parentheses
declare @int int = 10
select top (@int) * from
bozo
select top (@int) * from
bozo
more things done to improve sql
if force order hint is used - put left joins after inner joins
create indicies on temp tables after inserts
create indicies on temp tables after inserts
Tuesday, March 24, 2015
to loop through a c# DictionaryList
you use a DictionaryEntry
Tuesday, March 17, 2015
Failed to find project file at path in CI
do a build with clean option checked
Monday, March 9, 2015
to avoid distributed transaction errors during debugging
on the callee comment out :
/*[OperationBehavior(TransactionScopeRequired = true,
TransactionAutoComplete = true)]*/
/*[OperationBehavior(TransactionScopeRequired = true,
TransactionAutoComplete = true)]*/
Thursday, February 26, 2015
debugging a windows service
follow this pattern in program file
#if DEBUG
MethodInfo mi = qCenterService.GetType().GetMethod("OnStart", BindingFlags.DeclaredOnly
| BindingFlags.Instance | BindingFlags.InvokeMethod | BindingFlags.NonPublic);
mi.Invoke(BlahService, new object[] { new string[0] });
Console.ReadLine();
#else
ServiceBase.Run(new
ServiceBase[] { BlahService });
#endif
Monday, February 16, 2015
recent things done to an important and complex sql query to improve performance
- changed cross- apply to cte's
- added indices that had all the output columns needed instead of using clustered index which forced more reads
- removed max varchar columns from initial query to avoid key lookups and retrieved them at end of sql
Sunday, February 1, 2015
asp.net: Invalid postback or callback argument
<%@ Page EnableEventValidation="false" %>
CORS in asp.net
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Methods" value="GET,POST,OPTIONS" />
<add name="Access-Control-Allow-Headers" value="Content-Type, soapaction" />
</customHeaders>
</httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Methods" value="GET,POST,OPTIONS" />
<add name="Access-Control-Allow-Headers" value="Content-Type, soapaction" />
</customHeaders>
</httpProtocol>
Friday, January 30, 2015
another simple sql question
drop table x
create table x(x int, y int)
insert into x values (1,2)
update x set x=y , y=x
select * from x
what happens
create table x(x int, y int)
insert into x values (1,2)
update x set x=y , y=x
select * from x
what happens
Thursday, January 22, 2015
Would you believe...
select 1 where 'Draft' like '%' + 'Dr' + '%'
select 1 where '%' + 'Dr' + '%' like 'Draft'
i guess its obvious that what follows like is a subset
select 1 where '%' + 'Dr' + '%' like 'Draft'
i guess its obvious that what follows like is a subset
Thursday, January 15, 2015
Getting values out of a JSON object in c# when the object is an array
var values = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(strVal);
foreach (var val in values)
{
blah.Add(int.Parse(val.First(x => x.Key.Equals("blahId")).Value.ToString()));
Downloading Files in MVC where excel is not actually opened
I inherited from FileResult and it did not download - even though I set download name
I did this and it works
public FileResult DownloadTextAsAFile(string data, string name)
{
string fileName = string.Format("{0}.csv", name);
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(data);
return new FileContentResult(bytes, "application/vnd.ms-excel") { FileDownloadName = name };
}
I did this and it works
public FileResult DownloadTextAsAFile(string data, string name)
{
string fileName = string.Format("{0}.csv", name);
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(data);
return new FileContentResult(bytes, "application/vnd.ms-excel") { FileDownloadName = name };
}
Wednesday, January 14, 2015
to select a particular forms elements in jquery
just use the form's id as one of the selectors
Force filedownload
response.AppendHeader("content-disposition", "attachment; filename=" + FileDownloadName);
Add an action to a form with jquery
$("#blah").get(0).setAttribute('action', blahURL);
Subscribe to:
Posts (Atom)