Archive

Archive for June, 2009

Check Length for columns, FK and others… PowerDesigner.

June 24th, 2009 Guilherme Morais No comments
I have faced a problem, few weeks ago, someone made the reverse from a huge DB to Power Designer 12.5, something with more than 100 tables… ( huge for me of course ) I had to change the name of the FKs (References), Sequences, Trigger and Columns putting in the pattern requested, but the names was recieving more than 30 Chars. To verify that without checking one-by-one I made a “Extend Model Definition” , below you will see what I made, maybe this could help you in the future.

For References I used, this script is:

 SQL |  copy code |? 
1
FUNCTION %Check%(obj)
2
   %Check% = True
3
   IF (len(obj.ForeignKeyConstraintName)>30) Then 
4
       %Check% = false
5
   end IF
6
End FUNCTION

For Sequences I used, this script is:

 SQL |  copy code |? 
1
FUNCTION %Check%(obj)
2
<obj>   %Check% = True
3
   IF (len(obj.Code)>30) Then
4
       %Check% = false
5
   end IF
6
End Function</obj>

For Table I used, this script:

 SQL |  copy code |? 
1
FUNCTION %Check%(obj)
2
   %Check% = True
3
   IF (len(obj.name)>30) Then
4
       %Check% = false
5
   end IF
6
End FUNCTION

And for Trigger, I used:

Function %Check%(obj)
 SQL |  copy code |? 
1
   %Check% = True
2
   IF (len(obj.name)>30) Then
3
       %Check% = false
4
   end IF
5
End FUNCTION

Vertical Bar in ZedGraphControl (repost)

June 23rd, 2009 Guilherme Morais 2 comments
During the last week I spend almost 4 hours trying to discovery how to put a vertical bar in a ZedGraphControl… the Wiki is very poor of explanations about this thinks… thank GOOD,I had found the solution in the CodeProject ( as always! ) I will re-post this one in here again just for facilitate in future research in the net:

To draw a vertical line in a chart ( ZegGraphControl ) like this two blue lines in the image (at right ) you need to do something like this:

Barra Vertigal in zedgraph

Barra Vertigal in zedgraph



 C# |  copy code |? 
1
    LineObj myLine = new LineObj( Color.Black, 2.3, 0, 2.3, 1 );
2
    myLine.Location.CoordinateFrame = CoordType.XScaleYChartFraction;
3
    myLine.Line.Width = 2.0f;
4
    myPane.GraphObjList.Add( myLine );

thanks to JChampion , to see the original post go to : Re: Add Vertical Lines to mark tolerances?

Gerar Graficos em C#. (repost)

June 23rd, 2009 Guilherme Morais 2 comments
Esta semana estive buscando uma forma facil de criar graficos para o C#, tenho que utiliza-lo no meu próximo projeto. Acabei “tropeçando” na class libary ZedGraph uma biblioteca muito fácil de usar e com uma documentação bem elaborada. Engraçado como à algum tempo atrás eu tinha procurado sobre o assunto e não havia encontrado nada “FREE”, porém com esta nova biblioteca que funciona tanto para Windows Forms como para Web Forms pretendo retomar alguns projetos que tinha abandonado. Dêem uma olhada nos exemplos em C#, tem até exemplos em VB.NET

Dêem uma olhada:


Convert Solution of Visual Studio 2008 to 2005 and vice-versa (Repost)

June 18th, 2009 Guilherme Morais No comments
The Project Converter is the solution of openning a solution of VS2008 in the VS2005 and Vice-Versa.’, ‘

This is becoming a commom problem (to me at least).  In my home I have the Visual Studio 2008 , when I have to work in a little projects in .net 2.0 and I want to bring to my work, which is Visual Studio 2005, I have the problem of openning the solution to keep working, BUT the VS2008 save the solution file (solution.sln) in version 10, so the VS2005 can´t openning… So I have google for a while and found this little helpfull thing…  What he do?He convert the solution AND the projects to work with 2005 and vice-versa. This is pretty simple but is pretty helpfull too. I hope this helpanyone like me…
So thanks for Emmet Gray.

PS: I Just Add one warning if the version of the framework is 3.5 and it´s converting to 2.0, too explain the solution won´t work…

[PT-Br]

Falta de Compatibilidade entre o novo Visual Studio 2008 e o 2005 não é novidade, mas a Microsoft poderia ter implementado uma forma de salvar a solução (quando construida no framework 2.0  ) compativel com a versão do VS2005. O meu problema é aparentemente comun,criei um pequeno projeto no VS 2008 utilizando apenas o framework 2.0, salvei o projeto na pendrive para trabalhar na hora do almoço no trabalho, porem o VS no trabalho é a versão 2005, logo o projeto não abriu. Perdi o meu tempo livre procurando uma forma de converter a solução do VS2008 para a VS2005. Graças a uma boa alma: Emmet Gray, eu consegui encontrar um projeto que realiza está conversão. O “Project Converter” consegue converter a solução e seus projetos do VS2008 para o VS2005 e vice-versa.