Monday, February 23, 2009

Join-Cross join

A join is a query that combines rows from two or more tables, views, or materialized views.
Most join queries contain WHERE clause conditions that compare two columns, each from a different table. Such a condition is called a join condition.
CROSS JOIN (Cartesian product) is the simplest join.
We can start with the simplest possible join -- the "cross join" (or Cartesian product). If we have two database tables consisting of information about CDs and musical artists:






A join simply multiplies the two tables together into a new virtual table. There are four members of the Artists table and seven members in the CDs table which will result in 28 (!) rows in the result. You can try this using the following syntax,
SELECT * FROM Artists, CDs
and you should see a result that looks like the following table:



This table is typically filtered using the WHERE clause, for example

SELECT * FROM Artists, CDs WHERE Artists.ArtistID=CDs.ArtistID

Thursday, February 19, 2009

Some Practical .Net Soultions !!

Que : How To Convet Uppercase later ?

Ans : Select UPPER (dir_name) as name from tbldirectots.
The out put will come like DENESH KUMAR, VIJAY SHUKLA


Que . How to get the image on the user page by DataReader ?

Ans : TitleImage.Imageurl=folderpath + dirv["au_page_image"].ToString() ;
Note : 1 . For getting the folderpath we use this code on .cs page public string folderpath =
ConfigurationManager.AppSettings["folserpath"].ToString () ;
2. This key is defined in the Web.Config file like that -
<>
< key="folderpath" value="upload/">
3. Upload is the folder where the image is stored .
4. ImageUrl is like txt for text box of Image .Like txtname.text .


Que : How to show the Image on the User Page by GridView ?
Ans : By This Code
'/> Note : 1. In The Upload folder , image is stored there .Image has two things one Image and
second its name (boy.jpg)
2. Image Name like (boy.jpg) is saved in database's field like (dir_image) .
Mistake : One mistake when i was using DataReader .
Ans : 1. In the DataReader while loop are used . i don't know foreach loop can be used or
not , but when i was using it was not working .I was using foreach loop in DataReader and it
was not working ,it takes of time but did't work and ultimately i used while loop and i got
my task .
2. Sql DataReader DerDr=DirCom.ExecuteReader() ;
if (DerDr.HasRows)
{ while(DerDr.Read())
DirName=DirName + "" + DerDr["dir_name"].ToString() +" "
1:
}


Que : What syntax is used for Back Button ?
Ans : < href="javascript:history.back(-1);"> Back

Que : A Query for select the fixed character ?
Ans : string str = "select top 4*,substring (pr_title,1,100) as detail from tblProjectMaster
where pr_active='yes'and pr_delete='No' order by pr_iddesc" .


Que : What is the Syntax for Back link and Forword link ?
Ans : Syntax for Back link and Forword link :
< href="javascript: history .go (-1)">
< href="javascript: history .back(-1)">


Que : What is the code for OnImage Click ?
Ans : < width="100" class="hometxt">
< href="'Upload/<%">' rel="lightbox > <
img src='Upload/<% Databinder.Eval(Container,"DataItem.image") %>' style=""bordercolor=""
width="" hight="" border="" />
On putting mouse over image this link will appear -
http://localhost:1713/smi/upload/sunset.jpj .


Description of Project !!



Take an example of Project and we will discuss that how can you describe a project, there is an project SMI, and it is its URL...
http://www.smigroup.com.au/

Description of Project : SMI Project Description

SMI project has module 2 module : First is User and Second is Admin .
Here first i am explaing about User Part :
user part has the following module :
1. Home
2.About Us
3.Leadership

4.SMI Project Sulutions
5.SMI Building Services
6.SMI Fire Services
7.News & Events
8.Careers
9.Contact Us
Module 2 : In this module we explane what we are and which types of services we are providing .
Module 3 : In This module we explain the we are leader in this fiels to provies services, by giveing any person or company status. That we are the leader in this field.
Module 4 : SMI Project Solution has there part :
1.Project Solutions Profile
2.Project Gallery
3.Key People
1 . Project Solution Profile :
SMI Project Solutions provides the following construction contracting and professional management services: Fitout and refurbishmentConstructionLump sum contractingBuilding and Fire ServicesDesign and constructProject and construction managementProgram and cost management
This page show two thigs : Know about our KEY PEOPLE and second is Latest Projects .

In This page the 4 latest project has been shown with Project Code and Title . You can say this page is a like a listing of project and by this you can see aal the project by clicking show all link . And it ypu want to see the detail of the project just clik the image or link to see the detail of the project . In the project detail you can see 1. Project Code , 2.Duration (Starting Date and Ending date),3.Project Value (In Ruppes or $) , 4.Client (Client Name) , 5.Description . In The Description part there are some more information is being provided like - 1.Client Detail, 2.Architect, 3.Project Description , 4.Form of Contract Used ,5.Additional Information (With Project Detail there is also some image has been shown )
2 . Project Gallery : In the projct Gallery, you can see the - 1.Project Image , 2. Project Code , 3.Starting Date and Ending Date , 4.and Title of Project are shown as listing with 5 or 6 records and there is paging is being used .And link has been given to see the Detail in the Image and Title both .
If you want to see the Detailof the Project ,click the Image and see the Details. Details have the folloeing headlines - 1.Project Code ,2.Duration , 3.Project Value , 4.Title , 5.Client, 6. Description
. Description has folloeing headlines - 1.Client details , 2.Architect ,3.Project Description ,4.Project Description ,5.Additional Information (In additional information it explane about the project and some image of projects )
3.Key People : In this section 1.Team Leader/Director, 2.Project Manager ,3.Construction Manager, 4.Site Manager's Details are given With Their Photos.


Module 5 : SMI Building Services mdoule has simlarly three parts like the SMI Project Solution has
1.Building Services Profile
2.Project Gallery
3.Key People

Module 6 : Similarly SMI Fire Services has .

Module 7 : In The News and Events Module : The listing of New and Events are being shown in the form of Image , Title , Little Description and Date . Paging is also used in this page because the listings are shown in the 5 or 6 records.And if user wants to know about the Details the News and Events click the Title link and see the Details of the News. News and Events are shown in the following headlines - 1. Title , 2. Image ,3. Details itc.
Module 8 : In this module , this module look like that ;
We are expanding our team resulting in exciting opportunities in all areas of our business.
Our team consists of skilled, innovative and passionate people with unique ideas and approaches. We seek challenges, assume leadership, and continuously exceed goals. In return, we share in generous rewards and have the opportunity to be involved in some of the most exciting projects.
Please forward your CV via the contacts below.
E-mail:
reception@smigroup.com.au or Postal Address: SMI Careers20 Challis StreetDICKSON ACT 2602
Current Openings : By clicking this link we can find the vacanicies for different post with description . Any condidate who are interested can fill the form or apply for the specific post .

Module 9 : In this module we will get the information about the Company and maps, like that :
SMI FITOUT PTY LIMITED ABN: 91 115 312 546
Canberra
T : (02) 6230 6995F : (02) 6262 9945E :
reception@smigroup.com.au
Office Address20 Challis StreetDICKSON ACT 2602
Postal AddressPO Box 409DICKSON ACT 2602
View Larger Map







Server Contrl's ID Property !!



Que : What is the ID of ASP.NET server controls ? And why it is used ?

Ans : By ID property of the server control, we can uniquely identify the control.We can not have the two server contros on the same wev forms with same ID. The ID of server control is used as a reference in the c# source code behind file .cs file.
For your control's ID name use some meaning full nameing covention so that your code become more readable and easier to understand.It is very difficult to debug and maintain a program where the control names are TextBox1, Button1, and so forth.
So there are some prefixes appended with meaningful name for server control.
txt = TextBox (e.g. txtLastname)btn = Button (e.g. btnSavedata)ddl = DropDownList (e.g. ddlAccounts)chk = CheckBox (e.g. chkAdmin)rb = RadioButton (e.g. rbSpringsemester)


Event Handler Method !!

Que : What is Event Handler Method ?

Ans : An event handler method is a special type of Method in an ASP.NET web page that defines the actions that will occur when a particular event occurs.

Example : Take an examle of event handler method, first take an event : click event. We saw that if you are int the Design view for a wev form and you double click on a Buttion control, Visual Web Developer or Visual Studio will automatically generate an event handler Method called Buttion_Click.Basically an empty method is generated and Visual Web Developer or Visual Studio lets you put what ever code you want into that event handler.

Que : What is the meaning the event driven model ?


Ans : ASP.NET uses an event driven programming model.This means that in order for code to run, an event must occur that triggers or tells ASP.NET to run an event handler Method.

Que : What is the naming convention of Event Handler Method ?

Ans : Notice the naming convention that Visual Web Developer when it generates the event handler Method. The first part of the name is the ID for the server control: Button1. The second part of the name an underscore appended with the event type: Click. This convention helps you as the developer know when that Method will be called by ASP.NET. In this case, the click event fires when a user single clicks on the Button control.