473,779 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGrid & Datalist

40 New Member
I was asked in one of the interview--
Where We r use datagrid & Where we r use dalalist in our Application?

I have fetched the data using the dataGrid, But I do not kno abt the DataList.
DataList is not even in the Toolbox.

So pls reply to the answer asap & also send the code how to retrieve the data using DataList.
Mar 30 '08 #1
3 1342
balabaster
797 Recognized Expert Contributor
I was asked in one of the interview--
Where We r use datagrid & Where we r use dalalist in our Application?

I have fetched the data using the dataGrid, But I do not kno abt the DataList.
DataList is not even in the Toolbox.

So pls reply to the answer asap & also send the code how to retrieve the data using DataList.
What version of Visual Studio are they using and what version are you using?

They'll be using DataGrid and DataList in their .NET 1.0/1.1 Web Applications - if they're using the DataGrid in their 2.0 applications, they should think about upgrading.

I have 2008 and in my web application toolbox I have GridView and DataList (under the Data section)...I know that GridView was introduced in the 2003 version and prior to that they used DataGrid - it has of course been deprecated and replaced with GridView now which is basically DataGrid on steroids.

I've gotta admit, I've never used DataList, so I can't give any extensive details about it. At first glance it looks to be similar to GridView except that it's single column.
Mar 30 '08 #2
Yogesh Sharma
40 New Member
I m using the version 2005, & in 2005, there is no datalist under the data Tab.
Even u dont know how to fetch the records from the databse into the Datalist.

When to use datalist & dataGrid? can u asnwer dat?
Mar 30 '08 #3
balabaster
797 Recognized Expert Contributor
If you need a 2 dimensional grid - such as a spreadsheet style display, use a DataGrid, if you need single dimensional data such as a columnnar data...a list.

Expand|Select|Wrap|Line Numbers
  1.  <asp:SqlDataSource 
  2. ID="SqlDataSource1" 
  3. runat="server" 
  4. ConnectionString="<%$ ConnectionStrings:MyConnectionString%>"
  5. SelectCommand="SELECT Location_Key, Location_Name FROM [Location]" />
  6.  
  7.  
  8. <asp:DataList 
  9. ID="DataList1" 
  10. runat="server"
  11. DataSourceID="SqlDataSource1" 
  12. DataKeyField="Location_Key" >
  13. <ItemTemplate>Location_Key:
  14. <asp:Label 
  15. ID="Location_PKeyLabel" 
  16. runat="server" 
  17. Text='<%# Eval("Location_PKey") %>' /><br />
  18. Location_Name: 
  19. <asp:Label 
  20. ID="Location_NameLabel" 
  21. runat="server" 
  22. Text='<%# Eval("Location_Name") %>' />
  23. </ItemTemplate>
  24. </asp:DataList>
  25.  
Mar 30 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2182
by: DotNetJunkies User | last post by:
Hi, I was wondering if it is possible to load datagrid into datalist programatically using ITemplate interface with the following structure and place intp placeholder control. PlaceHolder - DataList - DataGrid (DataList Item) I have hierarchical data that I want to display using webcontrols whilst calculating minimum cost for each courier with Compute() method in DataGrid.
3
2784
by: CVerma | last post by:
Hi, I have an embedded datagrid within a datalist. I am not able to perfrom paging in the datagrid. Any ideas? Here is my code: Here is my Simplegrid.cs file: using System; using System.Collections; using System.ComponentModel; using System.Data;
9
5066
by: tshad | last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is filled? I have a bunch of DataGrids that get displayed nested inside a DataList. The datagrid looks like: ******************************************************************************* <asp:DataGrid visible="False" border=1
0
1703
by: Chris | last post by:
I've been searching all over and think I am close, but keep getting the error "Index out of range" when trying to reference a nested datagrid when an OnEditCommand event is raised. When the OnEditCommand event is raised, I try to do the following: 1. Find the selected datalist item in which the nested datagrid raised the event. (by calling getDataGridReference and returning the DataList's selectedIndex)
1
1888
by: Brock | last post by:
First note that I am using Framework 1.1. I have an .aspx page that is displaying a list of employees, but only the Employee Number, First Name, Last Name, and Title. It is working great. I recessed it in a <Div></Divto allow scrolling of just the data, not the page. What I need to do is place a DataList (also in a <Div></Divto allow scrolling of just the data) to the right of the Datagrid to show 40 Employee Detail fields (listed top to...
1
1921
by: Brock | last post by:
Thanks in advance... (you can see a screenshot of what my form looks like currently at http://www.juggernautical.com/DataGrid.jpg - the Datalist is super-imposed in 'design view' but the DataGrid is the actual running of the page) I've almost got this working (?) but need a little help. I have an .aspx page that has a DataGrid listing employees with a "Select" button that is to be used to populate the DataList to the right of the DataGrid...
2
1783
tjc0ol
by: tjc0ol | last post by:
Hi guys, Im just wondering that I cannot update my database throught datagrid datalist control, and the only thing works is that I can delete, cancel, edit but when I clicked update link there's an error that says: "Syntax error in UPDATE statement." I wonder what's wrong with my code and how to correct this one? Below are my codes: OleDbConnection objConn = new OleDbConnection( "Provider=Microsoft.Jet.OleDb.4.0;" + "Data...
1
1253
lee123
by: lee123 | last post by:
i have posted a post on here and waited several days for an answer if any now i have searched the web and found something different but the same with the datalist & datagrid here is the link: http://forums.devshed.com/visual-basic-programming-52/linking-datagrid-to-data-combo-box-vb6t-165208.html But when i did the example it worked, then i tried to do something on my own and failed..i have made a database with the "Visual Data Manager"...
17
2555
lee123
by: lee123 | last post by:
I know this is a free site and the moderators or anybody don't have to answer if they don't want to.. but if there is someone who knows how to answer this question please help with this one. i have changed my project so many times to try to get the results i want but can't seem to get this one thing to work the datagrid and datalist to work right. i have looked on the web to see if i could do it another way. and read so many books but there...
0
9632
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9471
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10136
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10071
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8958
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7478
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4036
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.