C# – Switch button (PushButton)

On these post LINQ table cloning I published a DLL that besides the cloning object there was a visual component called PushButton, it is just like a switch button, when clicked if it is on OFF position it changes to ON and fires an event (OnEnable), on the other hand if it is on ON position, it changes to OFF and fires the OnDisable event.

Some steps are necessary to use it:

Read More

C# – web reference dinamic generated webservice

If you have a webservice that constant gets updated with new methods, but you client anly calls the webservice, you don´t need to recompile both every time, as on MSDN you can have it generated dinamicaly

On MSDN, everytime you call a method, the reference is updated, in my case that was a problem since my cliente was an automatic calls set up periodically, with that from time to time I would get an execution error, so I twiked the code a little bit, so it only updates the reference the first time it is called.

Read More

C# LINQ- Table cloning

If you need to clone or copy records with LINQ, I developed a class for that porpouse.

Using Naspinski library found on codeplex and some reflections.

Read More

I was working on a project that already had a login page, they needed that this form validated against AD not as it was validating the user again a custom database table.
You can do it thought IIS, but they needed the same form not a box opening on the browser.
I developed a function for classic ASP that returns 0 or 1 if the user password match against AD.

Read More

SQL server – Open excel sheet

More then a solution it is a tip I got recently to open Excel spreadsheets on SQLServer.

Read More

C# LINQ – Get by primary key

I developed a project in C# with LINQ where the user had to manipulate a lot of data in a test base and them publish all to the production base.

How I developed this is for another post, but I hat to get registry by primary key, since the project had a lot of tables I didn’t want to write a procedure for each one, googling I found a library.

LINQ is based on reflections, for those who desn’t know LINQ means Language Integrated Query it is Hybernate from Microsoft to .NET, I know there is nHybernate around too, witch in short transforms tables to classes so you can instantiate it to manipulate the database.

The library...

Read More

C# – Winforms selfclose without error

I developed a .NET desktop program for a client so he could manage his database.

Since I did it with VS2010 ultimate, I thought it would be a good practice to use it’s setup and deploy project.

I can say for sure that configuring this project is not an super easy task as it should be, but that is for another post, I think the problem I got is very common, when you do that kind of project (the setup and deploy) VS2010 should hook inside the instalation file all assembly and library, but for some reason it didn’t and I was not aware of that, so I ended up with this problem, the program would kill itself right after it started.

After some ...

Read More