473,325 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

data grid

hi every one!
i'm trying to display my data using DataGrid,there is no Data
Grid control available in asp.net(vs 2005).i'm trying to do it
programmatically,but it shows nothing:i have used the following code:

con.Open();
OleDbCommand cmd1 = con.CreateCommand();
OleDbDataAdapter dap = new OleDbDataAdapter("select * from
admin", con);
OleDbCommandBuilder cb = new OleDbCommandBuilder(dap);
DataSet ds = new DataSet();
ds.Fill(dap, 0, 0, "admin");
DataGrid dg=new DataGrid();
dg.DataSource=ds;
con.Close();

plz guid me how to do it,i will wait anxiously

May 3 '07 #1
8 1179
"there is no Data Grid control available in asp.net(vs 2005)"

good grace it is not available !!!
you have GridView that is much more powerfull that DataGrid ;-)

http://www.gridviewguy.com has a lot of wonderful articlaes so you can
see what you can accomplish with this beutifull control

Bruno Alexandre

May 3 '07 #2
"Bruno Alexandre" <br*********@gmail.comwrote in message
news:11*********************@u30g2000hsc.googlegro ups.com...
good grace it is not available !!!
Of course it's available...

<asp:DataGrid ID="MyDataGrid" runat="server" />


--
http://www.markrae.net

May 3 '07 #3
"bushi" <bu*******@gmail.comwrote in message
news:11*********************@q75g2000hsh.googlegro ups.com...
i'm trying to display my data using DataGrid,
A much more powerful webcontrol <asp:GridViewwas introduced in VS.NET
2005 - you should use that instead.
there is no DataGrid control available in asp.net
The DataGrid control is still there if you absolutely must use it...

<asp:DataGrid ID="MyDataGrid" runat="server" />
--
http://www.markrae.net

May 3 '07 #4
// con.open(); not required.
OleDbCommand cmd1 = con.CreateCommand("add connection string here");
OleDbDataAdapter dap = new OleDbDataAdapter("select * from admin",
con);
// OleDbCommandBuilder cb = new OleDbCommandBuilder(dap); not required
DataSet ds = new DataSet();
ds.Fill(dap);
// DataGrid dg=new DataGrid(); place the control using page designer
dg.DataSource=ds;

// con.Close(); not required
dg.DataBind(); // add this line

-Praveen
"bushi" wrote:
hi every one!
i'm trying to display my data using DataGrid,there is no Data
Grid control available in asp.net(vs 2005).i'm trying to do it
programmatically,but it shows nothing:i have used the following code:

con.Open();
OleDbCommand cmd1 = con.CreateCommand();
OleDbDataAdapter dap = new OleDbDataAdapter("select * from
admin", con);
OleDbCommandBuilder cb = new OleDbCommandBuilder(dap);
DataSet ds = new DataSet();
ds.Fill(dap, 0, 0, "admin");
DataGrid dg=new DataGrid();
dg.DataSource=ds;
con.Close();

plz guid me how to do it,i will wait anxiously

May 3 '07 #5
OOps! error,
Conection stirng is not rquired on line number 3. Infact you dont need that
line at all!

"Praveen" wrote:
// con.open(); not required.
OleDbCommand cmd1 = con.CreateCommand("add connection string here");
OleDbDataAdapter dap = new OleDbDataAdapter("select * from admin",
con);
// OleDbCommandBuilder cb = new OleDbCommandBuilder(dap); not required
DataSet ds = new DataSet();
ds.Fill(dap);
// DataGrid dg=new DataGrid(); place the control using page designer
dg.DataSource=ds;

// con.Close(); not required
dg.DataBind(); // add this line

-Praveen
"bushi" wrote:
hi every one!
i'm trying to display my data using DataGrid,there is no Data
Grid control available in asp.net(vs 2005).i'm trying to do it
programmatically,but it shows nothing:i have used the following code:

con.Open();
OleDbCommand cmd1 = con.CreateCommand();
OleDbDataAdapter dap = new OleDbDataAdapter("select * from
admin", con);
OleDbCommandBuilder cb = new OleDbCommandBuilder(dap);
DataSet ds = new DataSet();
ds.Fill(dap, 0, 0, "admin");
DataGrid dg=new DataGrid();
dg.DataSource=ds;
con.Close();

plz guid me how to do it,i will wait anxiously
May 3 '07 #6
Datagrid is there - just add it to the Toolbox. As mentioned, DataGridView is
better and does all the same and more.
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"bushi" wrote:
hi every one!
i'm trying to display my data using DataGrid,there is no Data
Grid control available in asp.net(vs 2005).i'm trying to do it
programmatically,but it shows nothing:i have used the following code:

con.Open();
OleDbCommand cmd1 = con.CreateCommand();
OleDbDataAdapter dap = new OleDbDataAdapter("select * from
admin", con);
OleDbCommandBuilder cb = new OleDbCommandBuilder(dap);
DataSet ds = new DataSet();
ds.Fill(dap, 0, 0, "admin");
DataGrid dg=new DataGrid();
dg.DataSource=ds;
con.Close();

plz guid me how to do it,i will wait anxiously

May 3 '07 #7
thanx Mark...
it helps me.now tell me how i can update or delete the
records in it???
plzzzzzzz rply as soon as possible........
Mark Rae wrote:
"Bruno Alexandre" <br*********@gmail.comwrote in message
news:11*********************@u30g2000hsc.googlegro ups.com...
good grace it is not available !!!

Of course it's available...

<asp:DataGrid ID="MyDataGrid" runat="server" />


--
http://www.markrae.net
May 4 '07 #8
"bushi" <bu*******@gmail.comwrote in message
news:11**********************@n76g2000hsh.googlegr oups.com...
it helps me.now tell me how i can update or delete the records in it???
Google is your friend:
http://www.google.co.uk/search?hl=en...t+delete&meta=
plzzzzzzz rply as soon as possible........
See above...
--
http://www.markrae.net

May 4 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jordan O'Hare | last post by:
Hello Everyone, I am after some help with the following: I have a windows application that contains a list box and two data grids. All three controls are binded to a dataset that contains...
5
by: pmud | last post by:
Hi, I need to display columns in a data grid based on 7 different queries. Now I have 32 questions: 1. Is it possble to have 1 single data adapter with 7 queries & 1 data set or do I need to...
2
by: Josef Meile | last post by:
Hi, I'm using a ComboBox, some Textboxes, and a DataGrid to represent a many-to-many relationship between Person and Course. Each time that I change the value in the ComboBox (which for now is...
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
5
by: pmud | last post by:
Hi, I need to display columns in a data grid based on 7 different queries. Now I have 32 questions: 1. Is it possble to have 1 single data adapter with 7 queries & 1 data set or do I need to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.