Skip to main content

Posts

Showing posts from 2012

getting the list of class from dll in asp.net c# using Reflection

Reflection provides object(of type Type) that describe assemblies modules and types. so we can use  reflection to get the info about the assemblies i.e we can access  all types of objects in the dll.here I am going to demonstrate the use of Type and LoadFile to to get the name of the classes in the dll. demo code : using System; using System.Collections; using System.Reflection; namespace Zeewon.Tests {     public class GetClassInDll     {         public GetClassInDll()         {         }         //string dllname is the path of the dll //as LoadFile takes the absolute path the absolute path should be provided as parameter         public ArrayList GetClassName(string dllName)         {             Assembly assem = null;             try             {                 assem = Assembly.LoadFile(dllName);             }             catch (Exception ex)             {                 throw ex;             }             Type[] allType = assem.GetTypes();             ArrayList arrLis

Joins in sql

Join To return  a result set, combined from multiple tables joins are implemented . lets take the  two tables below for study.  Inner Join when inner join is applied it selects the rows which matches the join fields in both the table (simply it is called a join). query:                select s.StudentId,s.TeacherId,s.Name as student_name,t.Name as teacher_name                       from Student s   inner join Teacher t                       on s.TeacherId=t.TeacherId  result: Outer Join Left outer join Returns all rows from the left table (that means the table specified first in select statement) and only the matching rows from the next table(matching refers to the join fields being equal) query :            select s.studentId,s.teacherId,s.name as student_name,t.name as teacher_name                        from Student s left join teacher t on s.teacherId=t.teacherId order by t.Name result :  Right Outer Join Similar to

Simple example for Pivot in SQL

In this Post I am going to explain pivot with a simple example. In  general Pivot means a point on which a part rotates. In same thing applies,Here the Pivoting means making the column change to a row . With out further defining I would like to demonstrate it with a simple example. Figure above shows a table with two columns .Now I would like to change the columns to rows  I have the procedure above  : this is the result generated by above procedure . Explaining the procedure: The first line selects the data as the defined header after being pivoted .next selects the columns key and value  from the pivot table while the statement after pivot makes the value column as header and the key as data under the column. I hope this Post would help the beginners who are new to the SQL and want to learn the basic syntax of pivot. Thank you for reading . Any suggestions regarding the post are welcome .

A start with NerdDinner

Few days and still going on. just a new learner , enthusiast and with the hope of doing better . I am going through this blog just to put a little art of writing in what i have done in learning mvc. Going through it for about three days , i have gathered a little courage in what i am doing right now. After a little knowledge in model view and control while going through NerdDinner , I came up to create a view for a controller then a real work out was required .Right now i am going to stop my embarrassing writing and and explain what i went through during the last day in those three days. Creating a view in mvc gives us the option to create a partial view and a strongly typed view . I haven't gone through the partial view so i would just skip to the strongly typed view . While adding the strongly typed view we get the list of class that we have in the Model. selecting one of the class generates the view that is required to handle the instance field that we have created in the D