Saturday, September 27, 2008

Yetanother forums setup

Yetanotherforums being a pretty good forum made in Asp .Net can get pretty nasty when installing it, especially with iis 7.0
I found a site which describerd a few things on what to do especially with me getting all sorts of security exception, and then after going through that i had issues with sql server.
I still don't know how well it will cope up but it seems to be working.
a few things is required in the web.config file (rename default.config to web.config if this is a fresh installation) and change the yafnet section to look like this
<section name="yafnet" type="yaf.SectionHandler,yaf" requirePermission="false"/>

you may also require the following in the system.web section if you get a lot of configurationExceptions

<securityPolicy>
<trustLevel name="Full" policyFile="internal"/>
<trustLevel name="High" policyFile="web_hightrust.config"/>
<trustLevel name="Medium" policyFile="web_mediumtrust.config"/>
<trustLevel name="Low" policyFile="web_lowtrust.config"/>
<trustLevel name="Minimal" policyFile="web_minimaltrust.config"/>
</securityPolicy>
<trust level="Full" originUrl=""/>

After finally getting through the initial setup screens i started getting sqlClient exceptions.
Something to do with the column name never existed. It was something to do with the database being case sensitive. So i ran the scripts manually and it runs beautifully now.
I will be making the forums live after a few weeks and a lot of testing and setting up the site as it is required to.
I am also in a hunt for themes for this forums, but i assume this will have to be made to fit.

Thursday, September 4, 2008

Google chrome

Heard of Chrome yesterday and had it downloaded.
Scaringly, It runs well. For some unexplainable reason it seems faster than Firefox 3 or IE 7.
The interface is different, except with hows its done, the sub menus is directly pointed to the win32 API which looses its feel right there.
There are quite a few features, like it will remember what sites youve been upto, put them up in a set of tiles in your opening screen.So much for some privacy here. Still drastically looking on how to take certain sites off that list. It does have the bookmarks show up in the same tiled screen, which is good.
Has a very web page look, and makes very good use of the entire screen.
Though, there are a few drawbacks -
The tiled screen, it remember where you went. Well now i want it to erase its memory for a certain site.
Facebook, and certaing ajac rich pages freeze up. by freezing ofcouser the ajax scripts cant kick in and nothing happens. So thats when i get back to my IE7 or Firefox3.
I also noticed that the downloads were pretty dodgy. I couldnt download driver from HP's website. the browser threw up and said that the file does not exist in the server. i went and trried a few other files and it all said the same thing. Thankfully i gave it a go on firefox and the day was saved.
Guess the google beta concept makes it easy for them.
Gmails still in Beta !!!! guess thats how it will be

Sunday, August 24, 2008

Pictures

This is a pictures only area...
Koala Park
My House in Brissy

Wednesday, July 9, 2008

Printing Pdf from .Net

I recently came across printing crystal reports, and they always were unreliable when it came to printing a huge number of those documents. Even though I implemented my own queue, and processed them one by one, they always tended to fail at System.Drawing.Printing.something
With generally the handle being invalid.

I had a look at Adobe's own command line printing, but it always brought its windows up, and i could never manage to print in duplex mode, or change certain settings.

I can around a workaround with this, GhostView, and from the same creators comes GhostPrint
a tool called gsprint.exe has a pretty nifty way of telling what you can do, and set the printer, colour, duplex, landscape/portrait with arguments and made it very simple. the fact that this also has a pdf merging tool is fabulous.

The only issue i had was to determine if a document is to be printed in landscape or potrait.
But since i was creating the PDF's from Crystal Reports, I could determine those details using the ReportDocument class.

gsprint is a part of gsview which can be found at
http://pages.cs.wisc.edu/~ghost/gsview/

It has a good documentation and pretty easy to follow.

If you do have any issues do post in a message

Wednesday, June 18, 2008

Crystal report COM Exception

If you get this error:
{System.Runtime.InteropServices.COMException (0x8002000B)}

You probably have issues with using parameters .
I had an issue when the report was changed...and the parameters were deleted.
Since there were no parameters defined in the report, the exception occoured (aprt from things going haywire and no one knew what was happening. Rumor also went that they were stripped off their permissions to print)

Thursday, March 6, 2008

Reset Idendity Column

DBCC CHECKIDENT (tableName, RESEED, 0)

this resets the seed of all the idendity columns in the table

Saturday, March 1, 2008

Asp .Net - Role and Forms Authentication

A while Ago i decided to use both the Forms and role based Authentication for ASP .Net.

I had always created my own login, and used to create a session with the user information. Each time I loade a page that required access, my master pge woud have some code to check if a certain session existed, if not boot the user to the login page.

However Form Based Authentication meant that I would not have to remeber to create that code in every master page, especially when it was already there to use it.
Along with that, I wanted to use a role based authorization. Now with both these, while creting them using the Asp .Net configuration tool, always created its own database, and its own way of handling roles, and I felt i was not in control. Especially if i was to build a site admin to do that.

So I managed to search out articles on using my custom login control to my custom database, but the tricky part was assigning roles. I barely scratched the surface tring to search articles which would explain that.

With spending time trying to find out how it works, I struck upon the RoleProvider Class.
Within no time then i was able to create my custom roles, and now I could use my login table to hold the roles the user has, and make changes accordingly.

If you are struggling with the same I would be glad to help, until I put myself together and write up an article on it.

User Group and access manager

I was faced with the issue to create a user management in one of my applications, which allowed the user to only gain access to certain features of the Application.

Inititally, all the business required was to set up a user level, and then according to that level they would want the program to be hardcoded to allow access to users with atleast that access level..

Sounded a bit abnormal as the number of users was not small..it was medium and potential to grow, especially when the application had a possibility to be setup for other similar organizations.

So I then created this user group management, when you could create groups, and assign which features or programs the group had access to. Users could then be alloted to those groups. However certain users might be required to have access to some indiviadul features only, so that was also covered. I created this and applied it to a Windows forms, using 3rd party controls (Devexpress) and with its ribbon tabs, i could only show those tabs and those feature buttons to which the user had access to.

I had already started this from home, and created the management console in pure windows forms. Not as nifty as the 3rd party controls, but then serves the purpose in a similar way.
I created it as a DLL with its own database, however I was challenged with creating the strongly typed database to have access only to the database defined in the application refrencing this library.

The only catch to it is that the User's ID has to be in an integer format. Looking at this tool, It can be integrated into the management features, and can be used straigt from the box (just need to setup the database).

I have uploaded this to Codeplex and can be found at:
http://www.codeplex.com/AlterGearUserGrpMgmt

And yes I have a Name : AlterGear

This is filed under the LGPL Licence, so feel free to change anything in it and crete your own library from it.

At the moment, most of the code is within the form classes, So my next level to this is to split assignments into pure cs files so that the library can be used to build your own UI, rather than relying on the one provided within it. (Its not that bad)