Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 11th, 2006, 09:32 AM
Authorized User
 
Join Date: Dec 2006
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP.Net

How to display the data to Datagrid from SQLServer. i am using ASP.Net. give simple code

Venkatesan

  #2 (permalink)  
Old December 11th, 2006, 09:42 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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
  #3 (permalink)  
Old December 11th, 2006, 10:12 AM
Authorized User
 
Join Date: Dec 2006
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank u
i enter ur code but
Datagrid is empty

  #4 (permalink)  
Old December 11th, 2006, 10:24 AM
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

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.
  #5 (permalink)  
Old December 11th, 2006, 10:29 AM
Authorized User
 
Join Date: Dec 2006
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

'object of Stored Procedure
Objds = ObjPId.ProjMain
DBGrid.DataSource = Objds
DBGrid.DataBind()

venkatesan

  #6 (permalink)  
Old December 11th, 2006, 10:36 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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
  #7 (permalink)  
Old December 11th, 2006, 10:48 AM
Authorized User
 
Join Date: Dec 2006
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

' Projmain is dataset
'objPId is public class
                Objds = ObjPId.ProjMain
                DBGrid.DataSource = Objds.Tables("Data")
                DBGrid.DataBind()

  #8 (permalink)  
Old December 11th, 2006, 10:55 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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
  #9 (permalink)  
Old December 11th, 2006, 11:20 AM
Authorized User
 
Join Date: Dec 2006
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

----------- 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

  #10 (permalink)  
Old December 11th, 2006, 11:22 AM
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

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.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 3.5 answers in Professional ASP.NET 3.5 jminatel ASP.NET 3.5 Professionals 1 August 22nd, 2011 07:34 AM
Turning a regular ASP.NET App into an AJAX ASP.Net donrafeal7 Ajax 2 August 31st, 2007 12:33 AM
Database diagram in .net using asp.net,c#.net scotttiger ADO.NET 2 February 16th, 2005 01:35 AM



All times are GMT -4. The time now is 04:15 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.