Site Meter Asp.Net-Csharp,Asp,Ado.Net,Ado,Micosoft,Visualstudio,Visual webgui: October 2009

Tuesday, October 27, 2009

Difference between Repeater , Datalist, DataGrid(or GridView)

Difference between Repeater , Datalist, DataGrid(or GridView)

Repeater :

It contains Header Template, Item template , alternate
Item template and footer template . it can't support
Selection, editing, sorting and paging. this is read only
and fast.

Datalist :

It contains Header Template, Item template , alternate
Item template , Edit itm template and footer template . it
can't support sorting and paging but support selection and

DataGrid(or GridView) :

It contains Header Template, Item template , alternate Item
template , Edit itm template and footer template . it can
support selection, editing , sorting and paging . Mostly
every developer caught used this control.

Datagrid vs Gridview

In datagrid you cannot set a permisiion level........

In gridview you can do the access level............

GridView is a composite data-bound control and shares a common set of methods and properties with all other data-bound controls, including DropDownList, DetailsView, and ListBox.

GridView can render on mobile devices.

Grid view Control take care automatically deletes or updates records from the datasource.

Sunday, October 25, 2009

Gridview Rowdatabound.

Gridview Rowdatabound:

DataKeyNames="id" OnRowDataBound="GridView1_RowDataBound"

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)

if (e.Row.RowType == DataControlRowType.Pager)
e.Row.Cells[1].Text = "RS. " + e.Row.Cells[1].Text;

Thursday, October 22, 2009

sql connection string in

Connetion string used for mssql server which is installed in you server.

SqlConnection sqlcon = new SqlConnection("data source=localhost;Initial Catalog= ur database name; User Id=XXX; Password=XXX");

Connetion string used for mssql server which is installed in you system(ie .sql
server management studio express)

SqlConnection sqlcon = new SqlConnection("Server=.\\SQLExpress;Initial Catalog=ur database name; User Id=XXX; Password=XXX; Integrated security=true");

Calendar Control in

Calendar Control:

TO get calendar selected value to textbox:

this.shippeddate.Text = Calendar1.SelectedDate.ToShortDateString();
Calendar1.Visible = false;

Validation control in

RegularExpressionValidator-To accept only numbers


RegularExpressionValidator-To accept only characters not numbers.


RegularExpressionValidator- Expression to get minimum value and maximum value from the user


Monday, October 12, 2009

SilverLight 3.0 Features.

Silverlight 3.0 Features:

1.SLOOB(SilverLight out of browser).

Its like a java Applet(Application embedded into browser).but in silverlight we can get that application out of browser and we can use it and access/modify it.After finishing your work you can update it.

We can download that Apllication into your local system by the following ways,

A, Context Menu(By right clicking the app in the browser u can install it in your local system.

B, By the Button click event(Here you can write your program for the installation of Browser App).

There are two main events (Trigger and Network Event)

Network Event:

When you are working in your App(online) if suddenly your connection disconnected it will gives status as its disconnected its done through coding.

Trigger Event:

When you are working in your App(offline) you can update ur app at anytime from the main app(online).By placing the button like install.


The files or datas what you are working with offline app it wont affect your local system other drives such as c:,d:,etc.....It's mean SECURITY.

It allot separate space for his work that place is ISOLATED STORAGE.

Default size of isolated storage 25MB. But it can extended to what ever size(UNLIMITED).

Difference between DotNet 1.0,2.0,3.0,4.0

DotNet 1.0 = Managed code.
DotNet 2.0 = Generics,ADO.NET.
DotNet 3.0 = Linq(Language Integarated Query),Partial Methods, VAR Keyword.
DotNet 4.0 = Dyanamic Programming.

DotNet 1.0 Understand It:

.Net managed code enjoy's benefits of CLR, which automatically checks for object scope and if it is not referenced by any object than it is removed from memory.

What is the difference between managed and unmanaged code?

Program written in any .net compatible language will go for
compilation for 2times.
In the first compilation of the program, the language
compiler will generate MSIL code which is the managed code. &

the code generated after the second execution ie by the CLR
is called unmanaged code which is machine understandable and
not by the user.

What is MSIL code ?

When the code is compiled, the compiler translates your code
into Microsoft intermediate language (MSIL). The common
language runtime includes a JIT compiler for converting this
MSIL then to native code.
MSIL contains metadata that is the key to cross language
interoperability. Since this metadata is standardized across
all .NET languages, a program written in one language can
understand the metadata and execute code, written in a
different language. MSIL includes instructions for loading,
storing, initializing, and calling methods on objects, as
well as instructions for arithmetic and logical operations,
control flow, direct memory access, exception handling, and
other operations.

DotNet 2.0: Generics,ASP.NET-AJAX.

DotNet 3.0: Understand It:

1.1-->Partial Methods(Refer:

1.2-->LINQ stands for Language-Integrated Query. This means we can use any relational or XML-specific features to our programming languages and runtime. It is a general approach query and provide facilities to the .NET Framework to access any kind of sources of information, not just relational or XML data. It's a Language-Integrated Query to indicate that query is an integrated feature of the developer's primary programming languages (for example, Visual C#, Visual Basic). Language-integrated query allows query expressions to benefit from the rich metadata, compile-time syntax checking, static typing and IntelliSense that was previously available only to imperative code.

The format of the query is more or less simillar to that of SQL. The Select, From, Where clauses are also used here with the same meaning but in different style/location/position. Here is an example of a LINQ program.

using System;
using System.Linq;

class sample
static void Main()
int[] arrMarks = {78, 90, 56, 45, 89, 23, 67, 93};

IEnumerable Distinction = from m in arrMarks
where m > 70
orderby m
select m;

foreach (int distMark in Distinction)

DotNet 3.5 Understand It:

WPF = Windows Presentation Foundation.

WPF is the latest in desktop app development in .Net. It features markup based layout much like The markup language is XAML. It provides a new way to develop desktop applications keeping UI and logic separate.

WCF = Window Communication Services

WCF is used to communicate between different applications with stuff like services. It is much like web services, but is much more robust and configuration enabled. WCF web services can be configured to act like asmx webservices, or use json or something else. Anything that represents a service can benefit from WCF, such as web services, windows services etc.

DotNet 4.0: Dyanamic Progamming

1.Named and Optional Parameters.(Refer:::
2.Integarated COM interop.
3.Co and Contra Variance(Used in interface and delegates).
4.Dyanamic Typed Objects.
5. Response.PermanentRedirect,Page.Keywords and Page.Description Properties for SEO

Example For Dyanamic Keyword:

Thursday, October 8, 2009

free sms webservice to send sms using way2sms

By the above web service link any one can able to send free sms through ASP.Net code via way2sms.

Implementation of webservice in our codee:

Before using you should create way2sms account to use this webservice.

Method to add webreference in visual studio:

1.Rt click ur project and click AddWebReference and paste the above top link in it then it will produce xml code below and click ok.

then follow/use the below code

you can write below code in Button event for trial purpose..
com.aswinanand.www.SendSMS sms = new com.aswinanand.www.SendSMS();
sms.sendSMSToMany("ur way2sms username","password","to number","message");