27 March 2009

Favorite Valetines Day Song (Prettyboy)

Note:Please Turn ON your speakers to listen a music

Hi..

It is really heart melted song for youth... specially girls will attract and love this song.. I have collected this from one of my friend who received from his X friend.. who would not be bold when receive like this lovely song..


23 March 2009

Fill Gridview using dataset



1. Create a table stud in database vijay as shown above

2. Design a form as shown above (Note: above displayed data will appear only while running)

3. For the DataGrid control right click on the toolbox and select choose items

4. From the list select the DataGrid – System.Windows.Forms

5. Write the following code.

using System.Windows.Forms;

using System.Data.SqlClient;

namespace Gridview_ds_sort

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

private DataSet gddataset()

{

SqlConnection cn = new SqlConnection("user id=sa;server=.;database=vijay");

SqlDataAdapter da = new SqlDataAdapter("Select * from stud",cn);

DataSet ds = new DataSet();

da.Fill(ds, "e");

return ds;

}

private void Form1_Load(object sender, EventArgs e)

{

DataSet ds = gddataset();

dataGrid1.SetDataBinding(ds,"e");

}

private void button1_Click(object sender, EventArgs e)

{

DataSet dt = (DataSet)dataGrid1.DataSource;

DataView dv = new DataView(dt.Tables[0]);

dv.Sort = "sname";

dataGrid1.DataSource = dv;

}

}

}