Really, if one will look at the http://www.kentico.com/cms-asp-net-features/Feature-Matrix.aspx to evaluate if Kentico CMS free edition is something that you can use for building a personal web site for your small non-profit organization, it will be clear that free edition contains only one blog. ok 1 blog will be enough for me, who cares, if our organization has only 10 people so let them use 1 common blog, that's all.
But, the truth is that Blog for the free edition comes without front-end editors for Blog. To post a blog message, you have to log in to CMSDesk (it is a content administration console) and add a new blog there.
I played with the blog page design trying to add a Edit Blog web part, but I got an error message saying that your license doesn't allow this.
Actual reason for this license limitation is that blog editing is implemented with the User contributions module (see Kentico developer's guide, Blog Module, On-site management via User contributions).
And, guess what, User contribution is not included neither in a Free edition nor in a profeccional one. So if you want to be your Blog a real blog, you will have to prepare 2K $ for an enterprise edition of Kentico. Or find another free blog engine for you .NET site (for example, subtext) :)
Thursday, March 26, 2009
Tuesday, August 19, 2008
Using Linq for SQL with FOR XML procedures
The problem is
I have a stored procedure in MS SQL that ends with SELECT ... FOR XML, and formerly I used XmlReader to access the data from it (by calling SqlCommand.ExecuteXmlReader())
Now I'm trying to figure out how to access to this using LINQ
With VS constructor I drag and drop this procedure into Linq To SQL data class designer.
It creates something like that
[Function(Name="dbo.my_Procedure")]
public ISingleResult my_Procedure([Parameter(Name="param1", DbType="VarChar(50)")] string param1, ... all other params)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo) (MethodInfo.GetCurrentMethod())), param1, ... all other params);
return ((ISingleResult)(result.ReturnValue));
}
Strange thing that actually procedure returns not a sinlgle line but a collection of arbitrary broken XML source (I'm just wondering what parameter controls the size of each piece)
So to put all XML together you need to create a stream (memory stream) or file and an XmlTextWriter object, opened over the stream and a code like that to select all parts of the XML
System.Collections.Generic.IEnumerable rawXMLLines =
(new my_ProcedureDataContext()).my_Procedure(param1, ....)
.Select( my_Procedure => my_Procedure.XML_F52E2B61_18A1_11d1_B105_00805F49916B);
foreach (string rawXML in rawXMLLines)
{
writer.WriteRaw( rawXML );
}
Well, not so much development work but...
Seems, that we lost here the main advantage of the SELECT ... FOR XML clause - an ability to write Xml to the output stream directly from XmlReader (that we get from ExecuteXmlReader()) , which is the most effective way if you are working with large XML files.
In the example, shown above, the results of the procedure is extracted by LINQ engine to the collection of strings before we start writing these strings one by one into output stream with XmlWriter.
I have a stored procedure in MS SQL that ends with SELECT ... FOR XML, and formerly I used XmlReader to access the data from it (by calling SqlCommand.ExecuteXmlReader())
Now I'm trying to figure out how to access to this using LINQ
With VS constructor I drag and drop this procedure into Linq To SQL data class designer.
It creates something like that
[Function(Name="dbo.my_Procedure")]
public ISingleResult
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo) (MethodInfo.GetCurrentMethod())), param1, ... all other params);
return ((ISingleResult
}
Strange thing that actually procedure returns not a sinlgle line but a collection of arbitrary broken XML source (I'm just wondering what parameter controls the size of each piece)
So to put all XML together you need to create a stream (memory stream) or file and an XmlTextWriter object, opened over the stream and a code like that to select all parts of the XML
System.Collections.Generic.IEnumerable
(new
.Select(
foreach (string rawXML in rawXMLLines)
{
writer.WriteRaw( rawXML );
}
Well, not so much development work but...
Seems, that we lost here the main advantage of the
In the example, shown above, the results of the procedure is extracted by LINQ engine to the collection of strings before we start writing these strings one by one into output stream with XmlWriter.
Labels:
ExecuteXmlReader,
FOR XML,
LINQ,
optimization
Thursday, August 14, 2008
Strange Oracle behaviour
In our project we have one very complicated query that involves 10 or more tables joined with left joins or inner joins
IN EACH TABLE there was a field DELETED.
Developer who writes a SQL query made a mistake forgetting to add an alias to the DELETED field in the following WHERE clause
select ...
from table1 t1 join table2 t2 on t1.table1_id = t2.table1_id etc...
WHERE DELETED = 0
and what was strange - there were no compilation errors, oracle executes that query but guess from what table it takes DELETED field? I don't know! But not from the first table :) This behaviour leads to the bug that was very hard to find, debug and correct.
Finally when developer corrected where condition, it starts work as expected
WHERE t1.DELETED = 0
It is not the first case that makes me furrious about Oracle!
IN EACH TABLE there was a field DELETED.
Developer who writes a SQL query made a mistake forgetting to add an alias to the DELETED field in the following WHERE clause
select ...
from table1 t1 join table2 t2 on t1.table1_id = t2.table1_id etc...
WHERE DELETED = 0
and what was strange - there were no compilation errors, oracle executes that query but guess from what table it takes DELETED field? I don't know! But not from the first table :) This behaviour leads to the bug that was very hard to find, debug and correct.
Finally when developer corrected where condition, it starts work as expected
WHERE t1.DELETED = 0
It is not the first case that makes me furrious about Oracle!
Subscribe to:
Posts (Atom)