Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 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 20th, 2006, 10:10 AM
Authorized User
 
Join Date: Nov 2006
Location: New Delhi, Delhi, India.
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to Bind Data in DataGrid

Hi
I am using this code to bind datagrid in Desktop Application with C# 2005.but Grid does't show any record. help me now.

SqlDataAdapter da = new SqlDataAdapter("select vendorname from vendorview order by vendorname", conVendor);
    DataSet ds = new DataSet("Vendor");
    da.Fill(ds);
     dgVendor.DataSource = ds;
    dgVendor.DataMember = "Vendor";

Thanks and Regards
Kumar Ashish
9350789189
__________________
Thanks
Kumar Ashish
krashishroa@yahoo.co.in
  #2 (permalink)  
Old December 27th, 2006, 02:36 AM
Authorized User
 
Join Date: Dec 2006
Location: , , India.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Sunnys Send a message via Yahoo to Sunnys
Default

hi
 just add line below dgVendor.DataBind(); if u r not using it

hope this will help u



  #3 (permalink)  
Old December 30th, 2006, 12:11 PM
Friend of Wrox
 
Join Date: Dec 2006
Location: , , .
Posts: 176
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi
you shoud add the table name in the fill statement like this :

for example if your table name is "test"
you shoud type

da.fill(ds,"test");

kiani mehdi

best regards
kiani mehdi
 


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
Datagrid Bind Problem param99 ASP.NET 1.0 and 1.1 Professional 1 November 23rd, 2006 12:34 PM
can we bind datagrid and dropdown list rakeshgv SQL Server 2000 0 August 21st, 2006 02:13 AM
Bind datagrid to recordset MAntis_sg Classic ASP Databases 0 May 15th, 2006 07:31 AM
Bind data to datagrid use 2 different SQL statemen yuenyong ASP.NET 1.0 and 1.1 Basics 2 November 22nd, 2005 06:44 AM
Bind image to the datagrid learner_7983 ADO.NET 3 November 1st, 2004 02:00 AM



All times are GMT -4. The time now is 01:33 AM.


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