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

Wednesday, February 3, 2010

what is localization and globalization in

what is localization and globalization in

Globalization is the process of designing and developing applications that function for multiple cultures. Localization is the process of customizing your application for a given culture and locale.

Create a Multi-Lingual Site with Localization and Globalization in

Clear example in video:

Create a Multi-Lingual in windows form application c#,winforms,c .net

Clear example step by step:

Friday, December 11, 2009

Overview and example for Datatable in

Overview and example for Datatable in

MEthod 1:

DataTable cTable = new DataTable();
DataRow d3;

cTable.Columns.Add("A", typeof(string));
cTable.Columns.Add("B", typeof(string));
cTable.Columns.Add("C", typeof(string));

d3 = cTable.NewRow();
d3[0] = "A:";
d3[1] = B;
d3[2] = "C";


Method 2:

DataTable dtProducts = new DataTable();
DataColumn productColumn = new DataColumn();

productColumn.DataType = System.Type.GetType("System.Int32");
productColumn.ColumnName = "id";
productColumn.Unique = true;

DataTable dtProducts = createProductDT();

DataRow aProduct = dtProducts.NewRow();

aProduct["id"] = 11;
aProduct["thumb"] = "images/widget0.jpg";
aProduct["name"] = "Red Widget";
aProduct["price"] = 19.99;

Wednesday, December 9, 2009

Types,Modes,Differences of session in

Overview of session modes and types in

Normally http protocol is stateless to maintain state following namespace is used.


Modes And's Provider:

Session State Mode State Provider

InProc In-Memory Object
StateServer Aspnet_state.exe
SQLServer DataBase
Custom CustomProvider

Session Event's:

There are two types of session events available in

* Session_Start
* Session_End


1.inproc Mode (ie inprocess)--->Its availble inside the webserver itself not ouside the application.
2.StateserverMode(ie out process) -->Its availble outside the webserver,not inside the application.
3.sqlserver Mode -->To store session datas in sqlserver.AND DATAS CAN BE SHARED BETWEEN OTHE APPLICATIONS.
4.Custom Mode --> To create a manual session id's.

1.inproc Mode

Advantages :

* It store Session data in memory object of current application domain. So accessing data is very fast and data is

easily available.
*Datas not alive when application restarted.
* There is not requirements of serialization to store data in InProc Session Mode.
* Implementation is very easy, just similar to using View State.


If the worker Process or application domain recycles all session data will be lost.


This session state is totally managed by aspnet_state.exe.

This approaches has several disadvantages due to the overhead of serialization and de-serialization.

Datas will be alive it the aspnet services restarted also.

3.sqlserver Mode

The most easiest way to configure SQL Server, is using aspnet_regsql command.

4.Custom Mode --> To create a manual session id's.

Thursday, November 26, 2009

Find client and server ip address in,C#.

Find client and server ip address in,C#.

To get Server IP Address and Name(ie)where your domain hosted in an server:

1. string strHostName = System.Net.Dns.GetHostName();
2. string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();

To get Client IP address ie system current IP address:


Your IP address is:

The DNS lookup of the IP address is:

The method used to call the page:

The server's domain name:

The server's port:

The server's software:

Sunday, November 22, 2009

Download application or word or doc or pdf code in,c#

Download application or word or doc or pdf code in,c#
if (Page.IsPostBack){

Response.AddHeader( "content-disposition","attachment; filename=RegistrationFormDownload.pdf");
//Source from server
FileStream sourceFile = new FileStream(@"c:\inetpub\vhosts\\httpdocs\Form.pdf", System.IO.FileMode.Open,System.IO.FileAccess.Read, System.IO.FileShare.Read );
//Source from Local system
FileStream sourceFile = new FileStream(@"system file path", System.IO.FileMode.Open,System.IO.FileAccess.Read, System.IO.FileShare.Read );
long FileSize;
FileSize = sourceFile.Length;
byte[] getContent = new byte[(int)FileSize];
sourceFile.Read(getContent, 0, (int)sourceFile.Length);


Saturday, November 21, 2009

Differences::::Div vs span vs iframe

Differences::::Div vs span vs iframe

Blogger wont allow HTML content you can get full article which is given below from this link.You can download it..

DIV is short for "division" because it divides elements.

span is inline, div a block.span is permitted in a div, but not div in a span.

The main difference is that span element is in-line and usually used for a small chunk of in-line HTML whereas a div (division) element is block-line (which is basically equivalent to having a line-break before and after it) and used to group larger chunks of code.

is a block level element -- it's going to 100% width, and it will line break - and is best used for structure (stands for 'division' -- semantic markup here!)
is inline, it can go next to other elements and is best used for text editing... adding rules to special text in a paragraph, hiding text (like navigation), etc.


The div tag has forced a line break.
The div tag will force a line break.
The div tag has forced a line break.The span tag does not force a line break. There is no line break.

Reference to div tag properties::::

IFrame and Div are HTML tags. They are only for the layout purposes. Using IFrame, you can view another html file in your main html.
Div is used to display contents in a html page. You can put some text,image, and/or combination to display in a div.

An iframe is like having a hole on your page, and in that hole is another web page. If that page is clicked ONLY that page will refresh so that the rest of the site appears to stay in the same place. It's not valid HTML and is therefore not encouraged because browsers can interpret iframes however they want. An iframe is only a container and the page that goes inside it still needs to be written as usual.

To get small idea to get what is div tag

#framearea {
width: 550px;
height: 150px;
margin-bottom: 10px;
.framebody {
overflow: auto;
width: 550px;
height: 150px;

...content here...

Using a DIV as variable to write into IFRAME

Saturday, November 14, 2009

Installing windows Azure ,

Installing windows Azure SDK7

IIS 7.0 has to be configured in Vista.8
ASP.NET Application Development components installed.2

WPIlauncher install(Microsoft Web Platform Installer 2.0 Beta)4

Click on the Web Platform tab and customize the Web Server option with:
ASP.Net, Default Document and CGI (if you want to run fastCGI apps)

Click “Install” when you are ready. You’ll get an opportunity to review your selection,
then the download and install will commence.

Finally, if you are using WCF, you will want to install WCF HTTP Activation. (this is a .Net feature)

On Vista: From the Start menu, choose Settings | Control Panel | Programs | Programs and Features,
Click Turn “windows Features On or Off”, under Microsoft .Net Framework 3.0, select WCF HTTP Activation

On Windows Server 2008 – In Server Manager under Features Summary, choose Add Features – under .Net Framework 3.0 Features, select WCF Activation.

Install the Windows Azure Tools

What is Localization,Resource,resx in,C#.

Please refer the following sites to get idea about What is Localization,Resource,resx in,C#. Resource file .resx) localize) for localize and resource file)

To retrieve table data using table column in,C#

SqlDataReader rdr = null;
SqlConnection sqlcon = new SqlConnection("Server=___;Initial Catalog=____;Integrated security=true");

SqlCommand cmd1 = new SqlCommand("select * from ____;", sqlcon);
rdr = cmd1.ExecuteReader();
while (rdr.Read())
string ___ = rdr.GetString(rdr.GetOrdinal("column name"));
string ___ = rdr.GetString(rdr.GetOrdinal("column name"));


Substring in,c#

To find the last character in a string
string lastCharacter = myString.Substring(myString.Length - 1, 1);
//i.e. the last character is a SubString of myString, one character long, starting one character short of the length of myString

To remove the last two characters of a string
string myNewString = myString.Substring(0, myString.Length - 2);
//i.e. the new string is a SubString 2 characters shorter than myString, starting at the beginning of myString