Welcome to Hellrocker's Collections

Hope its all of some use to computer users.............

Tuesday, March 22, 2011

Comma separated values from Stored Procedure

You might have stuck in a position where you need all or certain values of a particular column as comma separated string in your application. What do you do in that case?

Well, the generic approach for this is return the DataTable and iterate its column while adding comma after each value and forming a string or

we can read the result in a DataReader and keep reading it till next while following the above mentioned approach.

If the database server performance is not a major issue for you and if you prefer to write less code, in that case...


Here is a quick solution to perform the same at the database level...

Friday, March 18, 2011

Continued - Create all basic stored procedures for any table

In addition to my previous post of creating stored procedures for given table...

Here is the query that make use of previously created SP "MyTool" and create stored procedures for all user created tables in the current database...

So you don't need to execute my tool again and again for all the tables...

Create all basic stored procedures for any table

Here is the another quick solution to the SQL server database users for creating all basic stored procedures for any given table...

Thanks to Kailash Paliwal, Ashish Chitranshi and Abhishek Mishra(my friends and the webteam) to search and make this functioning.

So read on and enjoy the database using database...

Thursday, March 17, 2011

An Ideal Log4Net configuration file

Well after receiving my first assignment on new job, I researched a lot on Google for Log4Net implementation and after 2 days of hair pulling I came up with this...

An idle configuration file to write to different log files for different types/levels of messages... check out and contact if require any clarification...

Just in your code behind use the following line, to implement the logging...

ILog ln = LogManager.GetLogger("<Logger Name from configuration>");
ln.Error(<message>, <exception>);