Image via Wikipedia
Thursday, July 22, 2010
Barcode Font
Tuesday, February 23, 2010
MS SSIS 2005
common error messages when dealing with SSIS. and you google alot to know the answer. some people advise to user derived columns!
but the problem is when initiating the data source itself.
So the answer is pretty simple:
for the field that produce this error, on the output field for this field make it not fail the componenet but rather ignor this error.
Thursday, October 8, 2009
nettiers dynamic search query
nettiers has a good functions like GetPaged that takes the where clause and search with it. but come on how to make this search with generic code and powerful!!!!
the solution is a magic word, "Reflection"!!! ta da .... you have to make your development framework ideal enough to do that. How?
As I said i am using nettiers this make me support the following: each entity has an interface describes each property. and a good naming convention that I can follow in naming the UI elements such as typed data sources, that nettiers generates, and so i wrote this code...
List<string> lookFor = new List<string>();
Type t = Type.GetType(string.Format("Entities.I{0}, Entities", EntityName));
foreach (PropertyInfo info in t.GetProperties())
{
if (info.PropertyType == Type.GetType("System.String"))
{
lookFor.Add(string.Format(" [{0}] Collate SQL_Latin1_General_CP1_CI_AS like '%{1}%' ", info.Name, txtName.Text));
}
}
string whereClause = string.Join(" OR ", lookFor.ToArray()) ;
DataSourceControl ds = WebFormUtil.GetControlByID(Page.Controls, EntityName + "DataSource") as DataSourceControl;
PropertyInfo filterProperty = ds.GetType().GetProperty("Parameters");
Object collection = filterProperty.GetValue(ds, null);
if (collection is ParameterCollection)
{
((CustomParameter)((ParameterCollection)collection)["WhereClause"]).Value = whereClause;
}
ds.DataBind();
with just the entity name as a variable, and the well formed structure of the tiers and the good structure of the any form that contains a list and a search box this code rocks. I am able to get the typed data source and attach a value to its attributes and finally get works done and generic.
Thanks to Reflection, it made it possible.
Thursday, September 17, 2009
Source Safe Error "File xxxxxxx is already open"
Tuesday, April 14, 2009
Entity Framework
It is good in the aspects mentioned above. But as Microsoft says, it is not a OR mapper. So, you cant get the benefits of the OR mapper like caching and database column validation, custom load, foreign keys values, and some like that.
All you have is the designer that you can do many things in it. and you have to edit this file for further subclassing conditions value - it saves the hexadecimal value and you have to change it manually, hope it will be solved at the final release- also, you can manage whether this table can be accessed via stored procedure or by generated query - if you select a stored procedure for one function like delete, you have to supply *sp for the rest update, insert :S - It is not complete now. Hope that it will be fixed in the final release. I made a comparison between Entity framework and .net Tier, and I found this
| Entity Framework | .net Tier | |
| one file contains entities and relations | contains many projects and files to represent the entities and its relations | No. of files generated |
| you can subclass entities based on condition easily from designer | you have to create the subclass file and modify the super-class manually | Super-class and subclass |
| entity object references not accessible outside domain [web service, WCF] | entity object accessible anywhere | entity object accessibility |
| queries accessible via linq and e-sql | accessible via defined functions | data retrieved |
| select query generated from linq and e-sql | select query defined in sp | select query |
| using the facade generated class for update and delete and insert, no e-sql | using the sp for all the operations | DML functions |
This is all as far as I used the Entity framework. it is good but not as good as hibernate.
*sp: stored procedure
Sunday, March 1, 2009
Javascript Good Stuff
It is about the Good parts and Bad parts of the Javascript language. I was shocked for some of the bad parts like 0.1 + 0.2 <> 0.3. check the video for more.
the video url is here
Tuesday, January 27, 2009
Visual Studio Add-on
This feature is vital when you are working in solutions each one consisting of more than 15 projects each project has folders and sometimes these folders contain folders :(
the problem when you want to reach a file you will manually collapse all those nodes then find your item. the worst thing when you are debugging and opened a file from outside the solution to read something then close it ......................... Visual studio behavior is miserable, it will open all the projects tree nodes, then you want to collapse all of them to focus on the selected node only.
I searched about this add-on and found one http://www.paraesthesia.com/archive/2004/06/25/solvent---power-toys-for-visual-studio-.net.aspx but it is for Visual Studio 2003.
hmmmm, Ok no deal I created one for VS 2005 ta.da.
the link is here