C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Training   ASP.NET Web Hosting    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

Play Silverlight Games or Submit your Silverlight applications and earn 90% AdSense revenue.

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Forums » .NET » ASP.NET »

datagrid


Posted Date: 09 Jan 2009      Posted By: ramalingam      Member Level: Bronze     Points: 1   Responses: 4



i am new bee in datagrid...

i want display data within datagrid

]can anyone help me....





Responses

Author: Pascal    09 Jan 2009Member Level: GoldRating:     Points: 4

Here is the simple code.. Need to change the SqlDataSource accordingly.

<asp:DataGrid ID="dg1" runat="server" DataSourceID="SqlDataSource1">
</asp:DataGrid>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:StarTekConnectionString1 %>"
ProviderName="<%$ ConnectionStrings:StarTekConnectionString1.ProviderName %>"
SelectCommand="SELECT [EmpId], [StartDate], [EndDate], [ShiftLogic], [ShiftType] FROM [AAAEmp_Details]">
</asp:SqlDataSource>



Author: Abhinav Misra    09 Jan 2009Member Level: SilverRating:     Points: 3

by default datagrid control is not shown in
toll box of vs2005 and vs2008\
you have to add dll for that
follow these step
1.go to you solution explorer
2.right click
3.click on add reference and select .net component
4.add datagrid dll

and then bound your datagrid control to the database table
using property of datagrid as

1>data source
2>data bound



Author: syed shakeer hussain     09 Jan 2009Member Level: DiamondRating:     Points: 3

Hi

How to display data in DataGrid using DataSet

SqlConnection conn=new SqlConnection("your connection string");
conn.Open();
SqlDataAdapter adapter=new SqlDataAdapter("select * from emp",conn);
SqlCommandBuilder builder=new SqlCommandBuilder(adapter);
DataSet ds=new DataSet();
adapter.Fill(ds,"emp");
Datagrid1.DataSource=ds.Tabales["emp"];

Happy Coding....



Author: Venkat    10 Jan 2009Member Level: BronzeRating:     Points: 1

Hai
U Can Bind the Grid by So many Ways .By Using Datasources and With the help of DataSet And Datareader Also.Better to Go Thru DataReader



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : creating setup file
Previous : slow browsing
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use