Sunday, July 22, 2007

First add a data grid view to the form

then go to the code file

on a buttons click event add the following code

U need to add the header named

using System.Data.OleDb;

private void button1_Click(object sender, EventArgs e)
{

OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\test.mdb;Jet OLEDB:Database Password=password");;

String queryString ="select UserID from UserTable where USerID > 2";

OleDbDataAdapter da = new OleDbDataAdapter(queryString, conn);
DataSet ds = new DataSet();
da.Fill(ds, "UserTable");
dataGridView1.DataSource = ds.Tables["UserTable"].DefaultView;

}

that's it. U r done. U can now add your custom query and use the data grid to show your results.

 

Enough for today. :D

Some links

http://www.codeproject.com/csharp/UsingDataGrid.asp

http://www.google.com/search?q=c%23+show+data+in+a+datagrid&btnG=Search&hl=en

http://www.c-sharpcorner.com/UploadFile/mahesh/DataGrid11282005234057PM/DataGrid.aspx

Friday, July 20, 2007

i made the decision let's see is it right or wrong

Saturday, July 7, 2007

First week

I am living at my brother's place for one week, but it seemed that I have left the hall for a long time, time goes slow here, last Friday I came to this place. Bought a freeze today :). All my salary is gone . Let's see what happens next. Am a bit tensed about some decisions. Gotta go