Today I explored generics properly and I must admit that I’m very sorry i did not take the time earlier
Bottom line : GENERICS ARE GREAT
Today I explored generics properly and I must admit that I’m very sorry i did not take the time earlier
Bottom line : GENERICS ARE GREAT
There has been a lot of talk about code generation and ORM software around where I was.
I got curious and embarked on a free codegeneration exploration. Being new to the concept of codegeneration my requirements were the following :
These are my findings :
The one that is most easily found is mygeneration with the dOOdads architecture out of the box. Of course you can create your own templates to customize the generated code to you your specific needs and architecture.
my generation can be found at : http://www.mygenerationsoftware.com/portal/default.aspx
It does work fine but the dOOdads architecture does not support relations and these you have to make yourself again. I found it all a bit too much fiddling about and it didn’t meet my 2 of my requirements, thus the search went on.
Next I found ORM.NET, which is the one I am using for the moment. Total setup time of a DAL that is easily queried 1,5 min flat. I was impressed, and best of all it is completely free. Apparently it is written by a consulting firm that used it for their internal needs. They no longer support it and it turned open source.
ORM.NET gets my stars. And I will be using it a lot in simpler scenario’s like websites etc.
ORM.NET can be found at : http://www.olero.com/OrmWeb/index.aspx?p=ORM.ascx
While looking for some documentation on ORM.NET I came across a link to ntiergen.net which can handle about any job. It generates stored procedures for you, along the DAL and the needed classes. You get to configure all your stored procedures beforehand and get the opportunity to create views and complicated queries through their interface. Normally it is priced at $449 but the link I found offers a fully functional licensed version open for the public. I downloaded it and just gave it a brief look as I am very pressed for time at the moment.
nTierGen.NET can be found at http://weblogs.asp.net/gavinjoyce/archive/2004/08/28/222017.aspx
Happy code generating !!!
After installing Dasblog I had problems with the compression module of Ben Lowery.
In .NET 1.1 I had exactly the same problems. No output was generated to the browser.
I dissected his code and found that it could be greatly simplified, so i decided to rewrite it to a .NET 2.0 version.
The first thing that needed to be done was rewrite the configuration, next get rid of all the inherited streams that were there for no reason in my opinion but to add some headers to the stream. I decided to hook them, the headers, up after I was sure that everything was compressed ok.
In the blowery module you can provide paths in the web.config that need to be excluded and this works well as long as your app is running on a virtual directory and not on a website. If your page is www.foo.com/default2.aspx that needs to be excluded his parser returns efault2.aspx so I changed that to work properly as well.
I’ve provided a zip with this post that contains the module, which you can use freely as long as you leave the copyright notice intact. If you have any questions do not hesitate to ask.
I changed blogs today. My new blog can be found at http://www.flanders.co.nz/blog
Together with the blog I also built a new site.. The only thing that is left to do for me is to migrate the posts from geeks to the new one.
This blog will allow me to post zip files with projects to go with the posts about coding that I do.
I really love .NET 2.0 everything goes pretty quickly. To build my new site I spent about 14 hours that is for designing, lay-out in masterpages, sql database and content input. The site is bilingual so when dutch people hit my site they get almost everything in dutch and the rest of the world gets it in english.
It seems that because datetime is a value type it is impossible to save a null value. If you use 2-way databinding in formview for saving dates. You will have problems even when just using a calendar control. This is the solution I found to my problem
In the html view change the Bind(”Date_Column”) into Eval(”Date_Column”)
<
asp:TextBox ID=”Timesheet_DateTextBox” runat=”server” Text=’‘ Width=”124px”>FONT color=#800000>asp:TextBox>
should then become
<
asp:TextBox ID=”Timesheet_DateTextBox” runat=”server” Text=’‘ Width=”124px”>FONT color=#800000>asp:TextBox>
I also want to store null values for unentered dates. A string you can null but this will give an exception like : System.String not a valid DateTime
i.e. for the objectdatasource inserting event i do it :
protected
void odsTimesheet_Inserting(object sender, ObjectDataSourceMethodEventArgs e)
{
e.InputParameters[0] = Guid.NewGuid();
e.InputParameters[4] = SetDate(“Timesheet_DateTextBox”);
}
private object SetDate(string controlname)
{
TextBox tb = (TextBox)fvProject.FindControl(controlname);
return (tb.Text.Trim().Length == 0) ? (object)null : (object)DateTime.Parse(tb.Text);
}
If someone knows a better solution or a codeless one please let me know.