.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 14th, 2004, 07:57 PM
thug_bugger thug_bugger is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 25 thug_bugger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
viewing datagrid

Hi

I have a datagrid. N i want to transfer my data from the database to the datagrid. But the problem is I cant display the datagrid when i run the codes.. It can only display the header.. Hope sumone can help me solve this prob.

Here is my code:

Public Sub bindListControl()

Dim myConn As OleDbConnection
Dim myOleDbAdapter As OleDbDataAdapter
Dim connStr, accessStr As String
Dim myDataSet As New DataSet

connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & _
"d:\db1.mdb"

accessStr = "SELECT * from MC"

myConn = New OleDbConnection(connStr)

myConn.Open()

myOleDbAdapter = New OleDbDataAdapter(accessStr, myConn)

myOleDbAdapter.Fill(myDataSet, "studentMCGrid")

studentMCGrid.DataSource = myDataSet.Tables("studentMCGrid")

studentMCGrid.DataBind()

myConn.Close()

End Sub

Reply With Quote
  #2  
Old March 15th, 2004, 02:02 PM
reinier's Avatar
reinier reinier is offline
reinier
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: The Netherlands
Posts: 6 reinier User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
viewing datagrid

Why do you use the following code for?? :

>studentMCGrid.DataBind()

I don't get this,
maybe, when you delete it in your code,
you might see your datatable.

goodluck,

reinier

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > viewing datagrid


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT