Wednesday, June 8, 2011

introduction to gridview

In this post i'll discuss about using asp.net grid view

first of all how to bind a grid view

 DataSet ds = read_from_xml();
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        GridView1.DataSource = ds;
                        GridView1.DataBind();
                    }
                }
here read_from_xml is a funtion which reads a xml file , parse it tinto a datatable and return into dataset 

DataSet is a set of data tables

Above is the code for cs which is used to bind the dataset with gridview.

now go to gridview and right click on it
go to properties
set autogeneratecolumns = true;
press F5 and see the results.

The page will show the content of the grid


Saturday, June 4, 2011

Asp.net Begining

So today i am finally start blogging on learning asp.net in just few hours.

So .net is basically a framework & we can  it FCL ( frame class library ). It consist of all the classes , controls and every thing which we use using Visual Studio 2008 or any newer version.

So here i am not going to cover each and every topic but instead i will provide some basic knowledge so that any one can start working immediately on some project.

so we do start with asp.net forms first.

so to start a new website you need to go to start menu and follow the given sequence

Start > All Programs > Visual Studio 2008
now you can see an application window on your screen showing a start page.

now go to file and follow the order

File > New > Website
It will create a new website with some name like website7

now click at ok

now you can see the application window and on side tab solution explorer showing all the files.

visual studio creates some files by default like

default.aspx > this is the aspx file which consist of all html code as we have code behind file named default.aspx.cs.

except this we have some other files as well like web.config which is the configuration file for this website only and one App_Data folder which is Asp.net folder and it is of limited access and all the database files will be placed there.


In the next topic i will tell how to create your first hello world Applications and in few days i will place all the screen shots as well.