Showing posts with label c#. Show all posts
Showing posts with label c#. Show all posts

Sunday, May 3, 2009

Business logic and the Entity Framework

I wrote a small article on CodeProject, with a sample project to dabble in. Check it out here: http://www.codeproject.com/KB/linq/entity_interceptors.aspx and let me know if you liked it!

Thursday, November 6, 2008

Long time no C[++,#]

Busy, busy, busy... and still am :)

Recently we were merging our domain(s) to one, big domain... which is not easy when the impact for the users should be zero (best case that is).

So, what did I learn?
First and foremost VBS *shiver* for the logonscripts and other neato thingies that needed to be done while the user cannot do much about them... which is most important, as these pesky people tend to stop whatever is running just to get to their 'Lotus Notes'.

Second... I did not find a way to make a simple, standalone program to set various (temporary) rights for the users in C#. And I *tried*... HARD... which brought me back to my trusty (and rusty) C++ Builder (I *hate* that registration process thing, Borland! And I *hate* the new help, get the old one back... much niiiicer)

Third... don't trust MS with their docs either... I found a few very *wrong* things they put into the Active Directory Schema docs... well... the Domain will recover :)

What is to expect next from me?
Weeeeeeell... a few posts with tips on what to do and what THE HECK NOT to do in Domainmigration, some neato things I got hopping in VBS (in your *face* Central Team! I *did* get it working, noobs), a neato thing discovered in C# (Yes, Kurt, still fiddling with it and not abandoned) and general riffraff I need to get out :)

There were some questions about me abandoning the blog... yeah... riiiight.

So... I try to post more regularly and keep you updated :)

Wednesday, August 6, 2008

70-561 bookable

You can now book for 70-561. ADO.NET 3.5. Wich is what i'll do this week.

Friday, July 18, 2008

Grab that icon with .NET

Many people just dont know there's a very easy way to get any program icon you need.
Here's the code
Icon icon = Icon.ExtractAssociatedIcon(@"C:\Program Files\Internet Explorer\iexplore.exe");
using (FileStream fs = new FileStream(@"c:\explorer.ico", FileMode.Create))
{
icon.Save(fs);
}

Thursday, July 3, 2008

Division by Cucumber?

Today I let loose my latest thingy, which reads some logs and parses them into a FoxPro table. See my post on it here.

It was working fine while in the sandbox but screamed hell when I set it loose in the wild. It threw a 'DivideByZeroException' all the time. After a while of debugging and crawling through my code I ended up here:
  1. System.Data.OleDb.OleDbCommand Com = new System.Data.OleDb.OleDbCommand(Instrucions[i]);
  2. Com.Connection = conn;
  3. Com.ExecuteNonQuery();
Line 3 threw the exception... but why? The instruction looked like 'insert into tablename (Col1, Col2, Col3) values ('One','Two','Three other things added here')'.
Thing was that the first round with another table went fine and that SQLstatement was a lot more complicated! So... what gives?

Took me about 2 hours of fiddling, cursing and sniffing through my code I found out the cause:
'Col3' is a FoxPro Memofield... sheesh.. which creates the need for the corresponding 'tablename.FPT' in the directory where the free tables reside. After that it worked like a charm.

So... all the crap in the web about some complicated parameteradding and such is safely discarded. The only thing is that you should chop your strings that should go into the memofield into 255 charater pieces as FoxPro works with stringlaterals that hold 255 chars max :)

Hope I could push you a step further to enlightenment :)