 |
| ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

December 11th, 2006, 09:32 AM
|
|
Authorized User
|
|
Join Date: Dec 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
ASP.Net
How to display the data to Datagrid from SQLServer. i am using ASP.Net. give simple code
Venkatesan
|
|

December 11th, 2006, 09:42 AM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
Populate a datatable (or dataset) with your result set then do:
datagrid.DataSource = dt;
datagrid.DataBind();
-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
^^Thats my signature
|
|

December 11th, 2006, 10:12 AM
|
|
Authorized User
|
|
Join Date: Dec 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thank u
i enter ur code but
Datagrid is empty
|
|

December 11th, 2006, 10:24 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi
Can you show us the code that you have written to fetch and bind data!!!
Regards
Mike
Fortune favours the brave, so don't regret on missed oppurtunities.
|
|

December 11th, 2006, 10:29 AM
|
|
Authorized User
|
|
Join Date: Dec 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
'object of Stored Procedure
Objds = ObjPId.ProjMain
DBGrid.DataSource = Objds
DBGrid.DataBind()
venkatesan
|
|

December 11th, 2006, 10:36 AM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
Don't double post. i dont see any code where you set up a connection or any other database objects???
-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
^^Thats my signature
|
|

December 11th, 2006, 10:48 AM
|
|
Authorized User
|
|
Join Date: Dec 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
' Projmain is dataset
'objPId is public class
Objds = ObjPId.ProjMain
DBGrid.DataSource = Objds.Tables("Data")
DBGrid.DataBind()
|
|

December 11th, 2006, 10:55 AM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
Show me your database connection objects and code.
-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
^^Thats my signature
|
|

December 11th, 2006, 11:20 AM
|
|
Authorized User
|
|
Join Date: Dec 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
----------- database Connection(SQL Server)
</system.web>
<appSettings>
<add key="ConnectionString" value="Password=;Persist Security Info=True;User ID=sa;Initial Catalog=AccuDocsWorkFlow;Data Source=SQLSERVER"/>
</appSettings>
Venaktesan
|
|

December 11th, 2006, 11:22 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Well Well
This is the connection string that you showing us, what dparsons meant was to show us the complete code that you have written (in your class) to fetch data into the dataset ds.
Regards
Mike
Fortune favours the brave, so don't regret on missed oppurtunities.
|
|
 |