Monday, December 22, 2008

Set Script src from root folder (dynamic)

if u are working with master pages and u are using javascript menus on master to navigate child pages in content place holder.
for that u need to save java script code in a particular folder and give path of that file in master page but as we know that path gets change when ever we go up and down in hierarchical of pages then that menu got disappear because of static path of .js file so we need to give dynamic path for java script file..and to do so we need to write following code to get dynamic path which can work in hierarchical up and down.

below code in design view of master page
< script type="text/javascript" src=" < %# Page.ResolveClientUrl("~/images/right_menu/data.files/rolen.js")% > " > < /script >

and following code in page load of master page
Page.Header.DataBind();
Read More

Friday, December 19, 2008

Horizontal Menu and Sub Menu

To generate Horizontal Menu and sub menu

< style type="text/css">
#topNav
{
width: 100%;
background-color: #964240;
vertical-align: bottom;
padding: 0;
margin: 0;
z-index: 0;
}
#subNav
{
width: 100%;
border-left: solid 1px #000;
border-bottom: solid 1px #000;
border-right: solid 1px #000;
padding: 0;
margin: 0;
height: 24px;
background-color: #eee;
}
.staticMenuItemStyle
{
width: 89px;
background-color: #7A1312;
border: solid 1px #000;
color: #fff;
text-align: center;
}
.staticSelectedStyle
{
background-color: #eee;
color: #000;
border-bottom: solid 1px #eee;
z-index: 100;
}
.staticHoverStyle
{
background-color: #902423;
}

.substaticMenuItemStyle
{
width: 89px;
background-color: #eee;
text-align: center;
}
.substaticHoverStyle
{
background-color: #D0D0D0;
border: solid 1px #A68F8F;
}
< /style>


< !-- code for design of menus creation, place it in master page or simple page eg:- RolenMaster.master-- >


< div >
< asp:Menu ID="Menu1" OnPreRender="setRef" runat="server" DataSourceID="SiteMapDataSource1" MaximumDynamicDisplayLevels="0" Orientation="Horizontal" >
< StaticMenuItemStyle CssClass="staticMenuItemStyle" / >
< StaticSelectedStyle CssClass="staticSelectedStyle" / >
< StaticHoverStyle CssClass="staticHoverStyle" / >

< /asp:Menu >
< asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" / >
< asp:Menu ID="Menu2" runat="server" DataSourceID="SiteMapDataSource2" MaximumDynamicDisplayLevels="0" Orientation = "Horizontal" >
< StaticMenuItemStyle CssClass="substaticMenuItemStyle" / >
< StaticHoverStyle CssClass="substaticHoverStyle" / >
< /asp:Menu >
< asp:SiteMapDataSource ID="SiteMapDataSource2" runat="server" ShowStartingNode="false" StartingNodeOffset="1" / >



< asp:ContentPlaceHolder OnPreRender="getRef" ID="ContentPlaceHolder2" runat="server" >
< /asp:ContentPlaceHolder >

< /div >


< !-- code in RolenMaster.Master.cs, code file of above page -->

protected void setRef(object sender, EventArgs e)
{
if (Menu1.SelectedItem != null) Session["lastTopMenuItemDataPath"] = Menu1.SelectedItem.DataPath;
}

protected void getRef(object sender, EventArgs e)
{
string ldp = Session["lastTopMenuItemDataPath"] == null ? "" : Session["lastTopMenuItemDataPath"].ToString();
if (ldp != null) foreach (MenuItem m in Menu1.Items) m.Selected = (m.DataPath == ldp && Menu2.Items.Count != 0);
}


< !-- site map -- >

< ?xml version="1.0" encoding="utf-8" ? >
< siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
< siteMapNode url="WebForm1.aspx" title="root" >
< siteMapNode url="WebForm1.aspx?ctrlID=1000" title="Admin" >
< siteMapNode url="WebForm1.aspx?ctrlID=1001" title="Create Project" > < /siteMapNode >
< siteMapNode url="WebForm1.aspx?ctrlID=1002" title="Create Workflow" > < /siteMapNode >
< siteMapNode url="WebForm1.aspx?ctrlID=1003" title="test" > < /siteMapNode >
< siteMapNode url="WebForm1.aspx?ctrlID=1004" title="not found" > < /siteMapNode >
< /siteMapNode >
< siteMapNode url="WebForm1.aspx?ctrlID=1100" title="Browse" >
< siteMapNode url="WebForm1.aspx?ctrlID=1101" title="Browse Projects" > < /siteMapNode >
< siteMapNode url="WebForm1.aspx?ctrlID=1102" title="Browse Workflows" > < /siteMapNode >
< siteMapNode url="WebForm1.aspx?ctrlID=1103" title="Welcome page" > < /siteMapNode >
< siteMapNode url="WebForm1.aspx?ctrlID=1104" title="Two.Four" > < /siteMapNode >
< /siteMapNode >
< /siteMapNode >

< /siteMap >
Read More

Thursday, December 18, 2008

Stop Refresh in Master / Child Page.

instead of using Master page use frame set to avoid refresh when click from menu to open a page
Steps:
1. add a webpage in ur application
2. add following code in design
< head runat="server">
< title>Untitled Page< /title>
< /head>

< frameset framespacing ="0" rows="100,*,50" noresize="yes">
< frame name="menu" src="headerpage.aspx" noresize scrolling="no" />
< frame name="content" src="" scrolling="auto" />
< frame name="footer" src="footerpage.aspx" noresize scrolling="auto" />
< noframes>
< body>
< p> your browser not support framesets< /p>
< /body>
< /noframes>
< /frameset>



3. add a webpage in ur application which will contain data of header
add following code in it (menu of header) to open pages in content area of page u added in step1
protected void Button1_Click(object sender, EventArgs e)
{
string url = "studentdetails.aspx";
string framescript = "";
Page.ClientScript.RegisterStartupScript(this.GetType(),"FrameScript",framescript);

}

4. add a webpage in ur application which will contain data of footer
Read More

Thursday, December 11, 2008

.NET Architect


Two types of architects are their

1. The software architect (solution architect)
2. The enterprise architect (binding business needs into the overall system/software architecture.



A good architect in my opinion should have the following characteristics regardless of technology:

1. The ability to take a complex problem and break it down into simple well defined manageable subcomponents that are loosely coupled. This reduces tight dependences, whereby, the architect can farm out subcomponents. Thus, allowing for true parallel development across a large team.

2. Architect and design a solid base application framework that allows for extensibility and ease of maintainability. In essence, design a system that can withstand the test of time, as well as meet other tenets of industrial-strength software.

3. Ensure that the application scales, and meet or exceed SLA commitments (i.e. security, performance, durability, robustness, etc)

4. Use best practices and architectural design patterns within reasons: DON’T over-engineering the system to death.

5. Do more with less: Use proven technologies and reusable library frameworks

6. Ensure that the system is highly automated, requiring little to no operator intervention, thus, reducing the Total Cost of Ownership (TCO)

7. Has a lot of real experience in truly distributed architectures. Someone who can talk-the-talk and walk-the-walk.

8. Enterprise architects should be very much able to defend, promote and sell the business case for the architecture to be of true value for the customer/company implementing their architecture. Unfortunately this comes with political skills as well, and these are normally obtained through years of experience in the field.

9. Enterprise Architect is much different than a Solutions Architect. Enterprise Architect is an individual that can walk into a business and model the business processes, lead the development of a strategic plan, etc. i.e. if you are familiar with the zachman framework (as an example, I know others exist) and have experience in that arena, you'll understand what an EA is. A solutions Architect can take a describe box or boxes and put together a solution. They can also provide guidance on standards, technology choices, etc. Finally, they help lead the development efforts with the technical team and provide a liason between the business and technical side. The sometimes work at a level similiar to a PM on a project, but not always.

10. A Solutions Architect is not just someone who understands technology. An SA understand people, understands the business, understands the technology, and has the experience necessary to meet the requirements on time, on budget, with customer satisfaction.

11. He should be familiar with all the latest fashion in software production with a rock solid discernment to shift out the gold from the fluff. In other words, able to choose the right path into the future.

12. Strive for KISS in all situation. He always keep "well-meaning impractical theorists" out of the project.

13. He is a good programmer (takes one to know one) but do not compete with his staff in the project.

14. He has experience before of the businessdomain of the project.

15. An architect mitigates the technical risks associated with a system. A technical risk is something that is unknown, unproven, or untested. Risks are usually associated with the service-level requirements and can occasionally be associated with a business requirement. Regardless of the type of risk, it is easier to address the risks early in the project while creating an architecture, then to wait until construction when you have a large developer base that could potentially be waiting while risks are solved.

16. An architect must lead the development team to ensure the designers and developers build the system according to the architecture. As the leader, difficult decisions must be made about trade-offs in the system and the architect is the person who must make those decisions. To lead, the architect must be a good written and oral communicator. It is up to the architect to communicate the system to the designers and developers who will build it. This is typically done with visual models and group discussions. If the architect cannot communicate effectively, then the designers and developers will probably not build the system correctly.

17. An architect should be able to produce and effect a business solution using whatever tools are reasonably and readily made available.

18. A true architect is resourceful enough to look at the problem, find and gain a knowledge of the basic resources (technologies and people) necessary to construct a solution that meets the immediate business need.

Microsoft Certified Architect Programs

The Microsoft Certified Architect (MCA) programs identify and certify top industry experts in IT architecture. Microsoft Certified Architects have proven experience designing and delivering the right IT solutions for enterprise customers. These MCA professionals typically have five or more years of advanced IT architecture experience, possess expert technical and leadership skills, and become part of an exclusive, world-class community of experts who continually collaborate on best practices within the IT industry. MCA candidates must definitively showcase seven competencies of business acumen and technological proficiency to a panel of industry experts in a Review Board interview in order to achieve the MCA credential. MCA certification was built by and for industry architects.
Read More

Tuesday, December 9, 2008

How to provide background image in TD from root path

use this code to provid background image url for TD which map to root path

< td align="left" background=' < %= Server.MapPath("~/images/rolen.gif") %>' >

u can also use this code also

< td align="left" background=' < %= ResolveClientUrl("~/images/box.gif") %>' >


well i prefer second "ResolveClientUrl" becoz ther Server.MapPath map path at server like c:\rajesh\rolen\mukesh.jpg
Read More

Set Master Page at Runtime

to set master page for any page at run time. u need to write following code


protected void Page_PreInit(object sender, EventArgs e)
{
this.MasterPageFile = "~/Business_Partner/businesspartner.Master";
}

but page should contain contentplaceholder of same name as it is in master which u are assigning it.
Read More

Thursday, December 4, 2008

Disable all validations for specific control

asp:Button ID="OkButton" runat="server" CausesValidation="false" Text="OK" OnClick="onOk"

set property named : CausesValidation to false if u want to disable validation for particular control


CausesValidation="false"
Read More

Friday, November 14, 2008

Microsoft Most Valuable Professionals (MVPs)

Microsoft Most Valuable Professionals (MVPs) are exceptional technical community leaders from around the world who are awarded for voluntarily sharing their high quality, real world expertise in offline and online technical communities. Microsoft MVPs are a highly select group of experts that represents the technical community's best and brightest, and they share a deep commitment to community and a willingness to help others.
for more details about MVP plez follow this link
Read More

Wednesday, November 12, 2008

Unable to connect to the Asp.net development Server

Many of times developer of Asp.net face problem that when they run web application they got this error message "Unable to connect to the Asp.net development Server" and their application not run..so to solve such a problem.
Precaution Points:
- when you install microsoft .NET first or still u not got such a error.then first copy following files from this path and save it in a folder
so that when ever u get such error then just copy it and overwrite it on existing corrupt files
path : C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0
Files:
1.WebDev.WebServer.EXE
2.WebDev.WebServer.exe.manifest

Solution:
If you r already faceing this problem then go to your friend's home and copy these (WebDev.WebServer.EXE, WebDev.WebServer.exe.manifest)
files and paste on this path
path : C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0
because this file not contain user or system specific information so..u can copy and paste for any other system.
Read More

Saturday, November 8, 2008

What is new in ASP.NET 3.5


 
Microsoft released ASP.NET 3.5 on November 19, 2007. Along with it, was released Visual Studio 2008. This evolution from ASP.NET 2.0 to ASP.NET 3.5 is quiet gradual. ASP.NET 3.5 uses the same engine as that of ASP.NET 2.0, with some extra features added on top of it. In this article, we will explore the new features added to ASP.NET 3.5. This article assumes that you have been working on ASP.NET 2.0.
New Features in ASP.NET 3.5
 
ASP.NET AJAX
In ASP.NET 2.0, ASP.NET AJAX was used as an extension to it. You had to download the extensions and install it. However in ASP.NET 3.5, ASP.NET AJAX is integrated into the .NET Framework, thereby making the process of building cool user interfaces easier and intuitive.
The integration between webparts and the update panel is much smoother. Another noticeable feature is that you can now add ASP.NET AJAX Control Extenders to the toolbox in VS2008. Even though this is an IDE specific feature, however I feel it deserves a mention over here for developers, who had to add extenders using source view earlier. It is also worth noting that Windows Communication Foundation (WCF) now supports JSON along with other standard protocols like  SOAP, RSS and POX.
New Controls
The ListView and DataPager are new controls added along with a new datasource control called the LinqDataSource.
ListView
The ListView control is quiet flexible and contains features of the Gridview, Datagrid, Repeater and similar list controls available in ASP.NET 2.0. It provides the ability to insert, delete, page (using Data Pager), sort and edit data. However one feature of the ListView control that stands apart, is that it gives you a great amount of flexibility over the markup generated. So you have a complete control on how the data is to be displayed. You can now render your data without using the tag. You also get a rich set of templates with the ListView control.
DataPager
DataPager provides paging support to the ListView control. The best advantage is that you need not have to keep it ‘tied’ with the control on which the paging is being done. You can keep it anywhere on the page.
DataPager gives you a consistent way of paging with the controls that support it. Currently only ListView supports it as it implements the IPageableItemContainer. However support is likely to be added to other List controls as well.
LINQ
LINQ (Language Integrated Query) adds native data querying capability to C# and VB.NET along with the compiler and Intellisense support. LINQ is a component of .NET 3.5. LINQ defines operators that allow you to code your query in a consistent manner over databases, objects and XML.  The ASP.NET LinqDataSource control allows you to use LINQ to filter, order and group data before binding to the List controls.

ASP.NET Merge Tool
ASP.NET 3.5 includes a new merge tool (aspnet_merge.exe). This tool lets you combine and manage assemblies created by aspnet_compiler.exe. This tool was available earlier as an add-on.
New Assemblies
The new assemblies that would be of use to ASP.NET 3.5 developers are as follows:
·         System.Core.dll - Includes the implementation for LINQ to Objects
·         System.Data.Linq.dll - Includes the implementation for LINQ to SQL
·         System.Xml.Linq.dll - Includes the implementation for LINQ to XML
·         System.Data.DataSetExtensions.dll - Includes the implementation for LINQ to DataSet
·         System.Web.Extensions.dll: Includes the implementation for ASP.NET AJAX (new enhancements added) and new web controls as explained earlier.
Some Other Important Points
1.    ASP.NET 3.5 provides better support to IIS7. IIS7 and ASP.NET 3.5 modules and handlers support unified configuration.
2.    You can have multiple versions of ASP.NET on the same machine.
3.    For those who are wondering what happened to ASP.NET 3.0, well there isn’t anything called ASP.NET 3.0.
4.    VS 2002 worked with ASP.NET 1.0, VS 2003 worked with ASP.NET 1.1, and VS 2005 worked with ASP.NET 2.0. However VS 2008 supports multi-targeting, i.e it works with ASP.NET 2.0, and ASP.NET 3.5. 

if u want to know more about multi-targeting feature of visual studio...plez follow this link
http://weblogs.asp.net/scottgu/archive/2007/06/20/vs-2008-multi-targeting-support.aspx
Read More
What is new in ASP.NET 3.5
 
Microsoft released ASP.NET 3.5 on November 19, 2007. Along with it, was released Visual Studio 2008. This evolution from ASP.NET 2.0 to ASP.NET 3.5 is quiet gradual. ASP.NET 3.5 uses the same engine as that of ASP.NET 2.0, with some extra features added on top of it. In this article, we will explore the new features added to ASP.NET 3.5. This article assumes that you have been working on ASP.NET 2.0.
New Features in ASP.NET 3.5
 
ASP.NET AJAX
In ASP.NET 2.0, ASP.NET AJAX was used as an extension to it. You had to download the extensions and install it. However in ASP.NET 3.5, ASP.NET AJAX is integrated into the .NET Framework, thereby making the process of building cool user interfaces easier and intuitive.
The integration between webparts and the update panel is much smoother. Another noticeable feature is that you can now add ASP.NET AJAX Control Extenders to the toolbox in VS2008. Even though this is an IDE specific feature, however I feel it deserves a mention over here for developers, who had to add extenders using source view earlier. It is also worth noting that Windows Communication Foundation (WCF) now supports JSON along with other standard protocols like  SOAP, RSS and POX.
New Controls
The ListView and DataPager are new controls added along with a new datasource control called the LinqDataSource.
ListView
The ListView control is quiet flexible and contains features of the Gridview, Datagrid, Repeater and similar list controls available in ASP.NET 2.0. It provides the ability to insert, delete, page (using Data Pager), sort and edit data. However one feature of the ListView control that stands apart, is that it gives you a great amount of flexibility over the markup generated. So you have a complete control on how the data is to be displayed. You can now render your data without using the tag. You also get a rich set of templates with the ListView control.
DataPager
DataPager provides paging support to the ListView control. The best advantage is that you need not have to keep it ‘tied’ with the control on which the paging is being done. You can keep it anywhere on the page.
DataPager gives you a consistent way of paging with the controls that support it. Currently only ListView supports it as it implements the IPageableItemContainer. However support is likely to be added to other List controls as well.
LINQ
LINQ (Language Integrated Query) adds native data querying capability to C# and VB.NET along with the compiler and Intellisense support. LINQ is a component of .NET 3.5. LINQ defines operators that allow you to code your query in a consistent manner over databases, objects and XML.  The ASP.NET LinqDataSource control allows you to use LINQ to filter, order and group data before binding to the List controls.

ASP.NET Merge Tool
ASP.NET 3.5 includes a new merge tool (aspnet_merge.exe). This tool lets you combine and manage assemblies created by aspnet_compiler.exe. This tool was available earlier as an add-on.
New Assemblies
The new assemblies that would be of use to ASP.NET 3.5 developers are as follows:
·         System.Core.dll - Includes the implementation for LINQ to Objects
·         System.Data.Linq.dll - Includes the implementation for LINQ to SQL
·         System.Xml.Linq.dll - Includes the implementation for LINQ to XML
·         System.Data.DataSetExtensions.dll - Includes the implementation for LINQ to DataSet
·         System.Web.Extensions.dll: Includes the implementation for ASP.NET AJAX (new enhancements added) and new web controls as explained earlier.
Some Other Important Points
1.    ASP.NET 3.5 provides better support to IIS7. IIS7 and ASP.NET 3.5 modules and handlers support unified configuration.
2.    You can have multiple versions of ASP.NET on the same machine.
3.    For those who are wondering what happened to ASP.NET 3.0, well there isn’t anything called ASP.NET 3.0.
4.    VS 2002 worked with ASP.NET 1.0, VS 2003 worked with ASP.NET 1.1, and VS 2005 worked with ASP.NET 2.0. However VS 2008 supports multi-targeting, i.e it works with ASP.NET 2.0, and ASP.NET 3.5. 

if u want to know more about multi-targeting feature of visual studio...plez follow this link

Read More

Friday, November 7, 2008

Using Extension Methods

How often do you want to modify existing classes to have extra methods? Quite often. Right? When you have source code of the classes under consideration at your hand then things are easy. You probably just add the extra methods to those classes. What if you don't have source code? Well. In such cases one approach is to inherit the existing classes and add extra methods to the child classes. However, this way may not be always correct and possible in terms of your application design and OO principles. Luckily, C# offers a quick way to extend your class functionality through a feature known as Extension Methods. Extension methods allow you to extend existing types without inheriting them. This article is going to throw some light on this handy feature.

Let's try to undertand what extension methods are with an example.
Assume that you are developing a discussion forum application. The forum displays date and time at which posts and replies are made. The discussion will be used primarily in India and hence you wish to show these timestamps in Indian Standard Time (IST). However, your servers are hosted in some different geographical region (and hence date-time offset) and hence you must do some adjustment to display all the times in IST.

You then decide to get the IST using the following lines of code:

DateTime dt=DateTime.Now;
DateTime utc = dt.ToUniversalTime();
DateTime ist = utc.AddMinutes(330);

The above code calls ToUniversalTime() method of the DateTime structure that returns date and time in Universal Standard Time (earlier known as GMT). You then add 330 minutes (5 hrs. 30 min.) to the UTC and get IST. Though the code is simple enough and your team can call it wherever they need, won't it be nice if you can have this functionality to DateTime structure itself? That way all team members will find it convenient to quickly get the IST from a specified time. This is where we will use a C# extension method to get our job done.



Creating Extension Methods

Have a look carefully at the following class that defines two extension methods:

namespace Utils
{
public static class DateTimeHelper
{
  public static DateTime ToIST(this DateTime dt)
  {
    DateTime utc = dt.ToUniversalTime();
    return utc.AddMinutes(330);
  }

  public static bool IsDate(this string s)
  {
    DateTime dt;
    return DateTime.TryParse(s, out dt);
  }
}
}


The above code defines a static class named DateTimeHelper. All the extension methods must reside inside a static class. The extension methods themselves must be static (In fact that is why compiler forces you to declare the class as static).

The ToIST() static method is an extension method that returns a DateTime instance. Observe how the parameter of the method is specified. An extension method can have any number of parameters but the first parameter indicates the data type to which that extension is applicable. In case of ToIST() method we specify that this method is an extension method of DateTime structure. The ToIST() method simply adjusts the date and time with required offset.

The IsDate() method is another extension method that will be applicable to string data type. Inside it checks if the supplied string is a valid date and returns a Boolean value.

Now, if you use DateTime structure then the Visual Studio will show you ToIST() method in the IntelliSense. Similarly, IsDate() method will be shown for string class.



More about extension methods

Though extension methods allow you to quickly extend an existing type this feature should not be used extensively as a replacement to other elegant approaches. Additionally, the following points about extension methods are worth noting.

Extension methods can chain themselves. For example you may write something like this:
dt.ToIST().ToDDMMYYYY()
The ToIST() and ToDDMMYYYY() are assumed to be extension methods.
Extension methods can be accessed only when its namespace is in scope
If an extension method has the same signature as any of the instance method of the class it extends then the instance methods take precedence
If two extension methods of a type have same signature them they must be called like normal static methods. For example, if you define two extension methods with same name and signature in two classes say DateTimeHelper1 and dateTimeHelper2, then they can be called  like this - DateTimeHelper1.ToIST(dt)
That's it! Will be back with something interesting. Till then keep coding!
Read More

Thursday, November 6, 2008

RSS (How to use RSS in ASP.NET)

RSS stands for (Really Simple Syndication). Basically RSS feeds are xml files which are provided by many websites so you can view their contents on your own websites rather than browsing their site. Suppose you are a movie lover and you want to get the list of top 5 movies from 10 websites. One way will be to visit all 10 websites and see the top 5 list. This method though is used in general by lot of people but its quite tiring method. It will take you 10-15 minutes to browse all the websites and see the top 5 list of movies. One easy way will be if those movie websites provides RSS feeds to be used by the users. If they provide RSS feeds you can embed them in your page and now you don't have to browse all the websites since the information is available on a single page. Hence, this saves you a time and a lot of browsing.

Most of the Blogs websites provide RSS feeds so you can embed your or someone's else latest entries of blog on your website. In this article we will see how we can embed RSS feeds to our webform using Asp.net.

create a gridview and a button on page and write following code...u will be able to access RSS of MSDN

you can replace this link with any other link of RSS of any other site...
just go to site and click on RSS link then that link will take u to a xml file for that RSS then copy that address and paste in XmlTextReader (  ...link) code.

using System.Xml;

protected void Button1_Click(object sender, EventArgs e)
    {
  XmlTextReader reader = new XmlTextReader("http://www.microsoft.com/feeds/MSDN/en-gb/rss.xml");  //this is address of RSS xml file
        DataSet ds = new DataSet();
        ds.ReadXml(reader);
        GridView1.DataSource = ds.Tables[2];
        GridView1.DataBind();
}
Read More

Friday, October 10, 2008

.NET Framework and Languages

As mentioned on the .NET Framework page, .NET Framework is designed for cross-language compatibility. Cross-language compatibility means .NET components can interact with each other irrespective of the languages they are written in. An application written in VB .NET can reference a DLL file written in C# or a C# application can refer to a resource written in VC++, etc. This language interoperability extends to Object-Oriented inheritance.
This cross-language compatibility is possible due to common language runtime. As you read on the .NET Framework page, when the .NET program is compiled, the output of the compiler is not an executable file but a file that contains a special type of code called the Microsoft Intermediate Language (MSIL). This MSIL is a low-level language which is designed to be read and understood by the common language runtime. Because all .NET executables exist as IL, they can freely operate. The Common Language Specification defines the minimum standards that .NET language compliers must confirm to. Thus, any code compiled by a .NET complier can interoperate with the .NET Framework.
The Common Type System (CTS) defines the rules concerning data types and ensures that code is executed in a safe environment. Since all .NET applications are converted to IL before execution all primitive data types are represented as .NET types. This means that, a VB Integer and a C# int are both represented in IL code as System.Int32. Because both the languages use a common and interconvertible type system, it is possible to transfer data between components and avoid time-consuming conversions.
Languages supported by .NET Framework
The table below lists all the languages supported by the .NET Framework and describes those languages. The languages listed below are supported by the .NET Framework upto the year 2003. In future there may be other languages that the .NET Framework might support.

APL-> APL is one of the most powerful, consistent and concise computer programming languages ever devised. It is a language for describing procedures in the processing of information. It can be used to describe mathematical procedures having nothing to do with computers or to describe the way a computer works.

C++ -> C++ is a true OOP. It is one of the early Object-Oriented programming languages. C++ derives from the C language.

VC++ ->Visual C++ is the name of a C++ compiler with an integrated environment from Microsoft. This includes special tools that simplify the development of great applications, as well as specific libraries. Its use is known as visual programming.

C# -> C# called as C Sharp is a full fledged Object-Oriented programming language from Microsoft built into the .NET Framework. First created in the late 1990’s was part of Microsoft’s whole .NET strategy.

Cobol -> COBOL (Common Business Oriented Language) was the first widely-used high-level programming language for business applications. It is considered as a programming language to have more lines of code than any other language. Component Pascal Component Pascal is a Pascal derived programming language that is specifically designed for programming software components. Curriculum No information.

Eiffel -> Eiffel is an Object-Oriented (OO) programming language which emphasizes the production of robust software. Eiffel is strongly statically typed mature Object-Oriented language with automatic memory management.

Forth -> Forth is a programming language and programming environment. It features both interactive execution of commands (making it suitable as a shell for systems that lack a more formal operating system), as well as the ability to compile sequences of commands into threaded code for later execution.

Fortran -> Acronym for Formula Translator, Fortran is one of the oldest high-level programming languages that is still widely used in scientific computing because of its compact notation for equations, ease in handling large arrays, and huge selection of library routines for solving mathematical problems efficiently.

Haskell -> Haskell is a computer programming language that is a polymorphicly typed, lazy, purely functional language, quite different from most other programming languages. It is a wide-spectrum language, suitable for a variety of applications. It is particularly suitable for programs which need to be highly modifiable and maintainable.

Java Language -> The Java language is one of the most powerful Object-Oriented programming languages developed till date. It's platform independence (not depending on a particular OS) feature makes it a very popular programming language.

Microsoft JScript -> Microsoft JScript is the Microsoft implementation of the ECMA 262 language specification. JScript is an interpreted, object-based scripting language. It has fewer capabilities than full-fledged Object-Oriented languages like C++ but is more than sufficiently powerful for its intended purposes.

Mercury -> Mercury is a new logic/functional programming language, which combines the clarity and expressiveness of declarative programming with advanced static analysis and error detection features. Its highly optimized execution algorithm delivers efficiency far in excess of existing logic programming systems, and close to conventional programming systems. Mercury addresses the problems of large-scale program development, allowing modularity, separate compilation, and numerous optimization/time trade-offs.

Mondrian->Mondrian is a simple functional scripting language for Internet applications. It is a functional language specifically designed to inter-operate with other languages in an OO environment. Current versions of Mondrian run on .NET. Mondrian also supports ASP.NET, allowing you to embed functional language code in web pages along with C# code.

Oberon -> Oberon is a programming language very much like Modula-2 in syntax but with several interesting features. It's based on OOP concepts and provides a Windows-based graphical user interface.

Oz -> Oz is a high-level programming language that combines constraint inference with concurrency. Oz is dynamically typed and has first-class procedures, classes, objects, exceptions and sequential threads synchronizing over a constraint store. It supports finite domain and feature constraints and has powerful primitives for programming constraint inference engines at a high level.

Pascal -> Principle objectives for Pascal were for the language to be efficent to implement and run, allow for the development of well structured and well organized programs, and to serve as a vehicle for the teaching of the important concepts of computer programming. The Prime area of application that Pascal entails is the learning environment. This language was not really developed to be used for anything other than teaching students the basics of programming as it was originally developed for this purpose.

Perl -> Practical Extraction and Report Language, Perl, is a language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It's also a good language for many system management tasks.

Python -> Python is an interpreted, interactive, Object-Oriented programming language. Python combines remarkable power with very clear syntax. It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing.

RPG -> Report Program Generator, RPG, is used for generation of reports from data files, including matching record and sub-total reports. RPG is one of the few languages created for punch card machines that is still in common use today. RPG or RPG IV is a native programming language for IBM's iSeries minicomputer system.

Scheme -> Scheme is a statically scoped programming language. It was designed to have an exceptionally clear and simple semantics and few different ways to form expressions. A wide variety of programming paradigms, including imperative, functional, and message passing styles, find convenient expression in Scheme.

Small Talk -> SmallTalk is an expressive language that uses a simple sub set of human languages, nouns and verbs. Smalltalk was the first, and remains one of the few, pure object systems, which simply means that everything in a Smalltalk program is an object. Smalltalk is generally recognized as the second Object Programming Language (OPL).

Standard ML-> Standard ML is a safe, modular, strict, functional, polymorphic programming language with compile-time type checking and type inference, garbage collection, exception handling, immutable data types and updatable references, abstract data types, and parametric modules. It has efficient implementations and a formal definition with a proof of soundness.

Microsoft Visual Basic-> Visual Basic is a "visual programming" environment for developing Windows applications. Visual Basic makes it possible to develop complicated applications very quickly. This site is all about Visual Basic.
Read More

XAML

Extensible Application Markup Language (XAML, pronounced zammel [zæml]) is a declarative XML-based language created by Microsoft which is used to initialize structured values and objects. It is available under Microsoft's Open Specification Promise. The acronym originally stood for Extensible Avalon Markup Language - Avalon being the code-name for Windows Presentation Foundation (WPF)
XAML is used extensively in .NET Framework 3.0 technologies, particularly Windows Presentation Foundation (WPF) and Windows Workflow Foundation (WF). In WPF, XAML is used as a user interface markup language to define UI elements, data binding, eventing, and other features. In WF, workflows can be defined using XAML.
XAML elements map directly to Common Language Runtime object instances, while XAML attributes map to Common Language Runtime properties and events on those objects. XAML files can be created and edited with visual design tools such as Microsoft Expression Blend, Microsoft Visual Studio, and the hostable Windows Workflow Foundation visual designer. They can also be created and edited with a standard text editor, a code editor such as XAMLPad, or a graphical editor such as Vectropy.
Anything that is created or implemented in XAML can be expressed using a more traditional .NET language, such as C# or Visual Basic.NET. However, a key aspect of the technology is the reduced complexity needed for tools to process XAML, because it is based on XML. As a result, a variety of products are emerging, particularly in the WPF space, which create XAML-based applications. As XAML is simply based on XML, developers and designers are able to share and edit content freely amongst themselves without requiring compilation. As it is strongly linked to the .NET Framework 3.0 technologies, the only fully compliant implementation as of today is Microsoft's
Read More

Silverlight

Microsoft Silverlight is a programmable web browser plugin that enables features such as animation, vector graphics and audio-video playback that characterize rich internet applications. Silverlight competes with products such as Adobe Flash, Adobe Flex, Adobe Shockwave, JavaFX, Curl and the JavaScript programming language. Version 2.0, now in beta-testing, brings additional interactivity features and support for .NET languages and development tools.Silverlight was developed under the codename Windows Presentation Foundation/Everywhere (WPF/E). It is compatible with multiple web browser products used on Microsoft Windows and Mac OS X operating systems. Mobile devices, starting with Windows Mobile 6 and Symbian (Series 60) phones, will also be supported. A third-party free software implementation named Moonlight is under development to bring compatible functionality to GNU/Linux.
Silverlight 1.0
A Silverlight 1.0 application hosted in Internet Explorer. Interactivity is provided by Silverlight, but user input controls are HTML controls overlaid on top of Silverlight contentSilverlight 1.0 consists of the core presentation framework, which is responsible for UI, interactivity and user input, basic UI controls, graphics and animation, media playback, Digital rights management, and DOM integration. It is made up of the following components:Input – handling input from devices like keyboard, mouse, stylus etc.UI core – managing rendering of bitmap images (including compressed raster images like JPEG), vector graphics, text and animations.Media – playback of MP3, WMA Standard, WMV7, WMV8 and WMV9/VC-1 streams.XAML – to allow the UI layout to be created using XAML markup language.A Silverlight application starts by invoking the Silverlight control from the HTML page, which then loads up a XAML file. The XAML file contains a Canvas object, which acts as placeholder for other elements. Silverlight provides various geometrical primitives like lines, ellipses and other shapes, to elements like text, images, and media etc. The elements are properly positioned to achieve the desired layout. Any arbitrary shape can be created as well. These elements can be animated using Event triggers; some animation effects are predefined, others can be created as composite of the pre-defined effects. Events like keyboard or mouse movements can also raise Events which can be handled by custom scripts
Read More

file extensions which are configured by default in ASP.NET 2.0

Here is a list of file extensions which are configured by default to be handled by ASP.NET 2.0.
asax used for application level logic
global.asax-ascx used for creating web user control.
ashx- used to create a custom httphandler
asmx- used to create web services
aspx- used for web application pages
axd- is used for special webresource axd handler which allows the developer to package component and controls along with javascript, images etc..in a single assembly. The extension is also used for trace output.
browser- are the browser capabilities files stored in XML format. These gfiles are used to define the capabilities of the browser.
config- used to store the configuration of the web application.
web.config and machine.config- are the common examplescs used as the code behind when the language chosen is C# (CSharp)vb used as the code behind when the language chosen is Visual Basic.Net
master- used as the extension for the master page.
resx- used as an extension for the resource file of the page for internationalization and localization purpose.
sitemap- is used as the configuration file for sitemap
skin- used as the skin file for the themes
svc- used to define a Windows Communication Foundation (WCF) based service
Read More

Know Any File Extension

if u want to know full form of any file extension then u can find out it on following web site............
www.fileinfo.net
Read More

Thursday, October 9, 2008

To show any .CHM help file in VB.NET

Help.ShowHelp(Me, "CHM LOCATION HERE!")
Read More

Search string with Wild Card

Public Function CheckWildCardString(ByVal String1 As String, ByVal String2 As String) As BooleanDim I As Long If Left$(String1, 1) = Chr$(42) And Right$(String1, 1) = Chr$(42) ThenString1 = Replace$(String1, Chr(42), Empty) For I = 1 To Len(String2) If LCase$(Mid(String2, I, Len(String1))) = LCase$(String1) ThenCheckWildCard = TrueExit FunctionEnd IfNext IElseIf Left$(String1, 1) = Chr$(42) Then If LCase$(Right(String2, Len(String1))) = LCase$(String1) ThenCheckWildCard = TrueExit FunctionEnd IfElseIf Right$(String1, 1) = Chr$(42) ThenString1 = Replace$(String1, Chr$(42), Empty)If LCase$(Left(String2, Len(String1))) = LCase$(String1) ThenCheckWildCard = TrueExit FunctionEnd IfElseCheckWildCard = FalseExit FunctionEnd IfEnd Function
Read More

Wednesday, October 8, 2008

Compress Files & Foleder in vb.net


Imports java.util.zip
Imports java.io

Public Class ZipUtility
Public Shared Function CreateZip(ByVal FileNames() As String, ByVal ZipFileName As String) As Boolean
'THIS SAMPLE WILL NOT ALLOW THE ZIP FILE TO BE CREATED IF IT ALREADY EXISTS
'MODIFY AS NEEDED, I WILL WORK ON ADDING IN SUPPORT FOR APPENDING AND OVERWRITING
If DoesFileExist(ZipFileName) Then
Throw New IOException("zip file already exists")
Return False
End If
Try
'OUTPUT STREAM THAT WILL WRITE OUT THE ZIP FILE, THIS
Dim MyOutputStream As New ZipOutputStream(New java.io.FileOutputStream(ZipFileName))
'FILE INPUT STEAM
Dim MyFileStream As java.io.FileInputStream
'OUR ZIP ENTRY, ONE FOR EACH FILE
Dim MyZipEntry As ZipEntry
'A BUFFER FOR THE I/O
Dim Buffer(1023) As SByte
'LOOP EACH FILE NAME IN OUR ARRAY
For Each FileName As String In FileNames
'CHECK THAT FILE EXISTS BEFORE TRYING TO INCLUDE IT IN THE ZIP
If DoesFileExist(FileName) Then
'CREATE A NEW ENTRY IN THE ZIP FILE, BASED ON THE FILE NAME
MyZipEntry = New ZipEntry(New IO.FileInfo(FileName).Name)
'SET IT TO DEFLATE (COMPACT IT)
MyZipEntry.setMethod(ZipEntry.DEFLATED)
'STICK THE ENTRY IN THE ZIP FILE
MyOutputStream.putNextEntry(MyZipEntry)
'CREATE A FILE STREAM TO WRITE THE FILE TO THE ZIP
MyFileStream = New java.io.FileInputStream(FileName)
'A COUNTER WHILE WE INPUT THE BUFFER INTO THE FILE
Dim nCount As Integer = 0
'LOOP THE INPUT FILE STREAM AND WRITE IT TO THE ZIP FILE
nCount = MyFileStream.read(Buffer, 0, Buffer.Length)
While nCount > 0
MyOutputStream.write(Buffer, 0, nCount)
nCount = MyFileStream.read(Buffer, 0, Buffer.Length)
End While
'CLOSE THE FILE STREAM FOR THE FILE BEING ZIPPED
MyFileStream.close()
'CLOSE THE ENTRY IN THE ZIP FILE
MyOutputStream.closeEntry()
End If
Next
'ALL DONE, CLOSE THE ZIP FILE
MyOutputStream.close()
'IF WE MADE IT THIS FAR, RETURN TRUE
Return True
Catch ex As Exception
'PASS THE EXCEPTION TO THE CALLING ROUTINE
Throw ex
'RETURN FALSE
Return False
End Try
End Function



you will require to download library to use above functionality
Read More

Tuesday, October 7, 2008

Connect .NET with MySQL

To connect .NET with MySQL u will have to follow following steps
  1. install mysql-connector-net-5.2.3 from net (its free)
  2. Import mysql.data which u will get in installation folder of above software
  3. import namespace = imports MySql.Data.MySqlClient
  4. then use mysqladaper,mysqlcommand,mysqlconnection as u use oledbdataatapter,oledbcommand,OleDbConnection
  5. when ever u will try to exis table which contain date in 00:00:0000 format then u will get exception like 'unable to convet mysqldatetime type to system datetime type' so to overcome this type of problem either make that datatime field in table as allow null or write the following in connection string "Allow Zero Datetime=true"
Read More
Powered By Blogger · Designed By Seo Blogger Templates