SunQuest
 
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

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 ASP Free Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old November 2nd, 2004, 05:18 AM
vmbs vmbs is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 36 vmbs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 24 sec
Reputation Power: 4
Unhappy How to change datagrid at Runtime

i have one datagrid and one adodc controler and i need to connect the adodc controler at run time with separate tables(record sources) by clicking one button it will show one table details by clicking another button it will show another table details

but When you click any button first time it will connect and show corresponding record.But for the second it wont display the new
Record sources

i also tryed by using rebind but something is missing please tel what to do this is the code under the two buttons ....it isnt working!!!
any idea what to do???



//code under commnad button 1

Private Sub Command1_Click()

Adodc1.ConnectionString = "dsn=jay"
Adodc1.RecordSource = "table1"
Set DataGrid1.DataSource = Adodc1

End Sub

// code under command button 2

Private Sub Command2_Click()
'DataGrid1.ClearFields
'DataGrid1.ReBind
Adodc1.ConnectionString = "dsn=jay"
Adodc1.RecordSource = "table2"
Set DataGrid1.DataSource = Adodc1

End Sub

Reply With Quote
  #2  
Old November 2nd, 2004, 01:16 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 19 h 31 m 41 sec
Reputation Power: 180
Did you try adodc1.refresh? Or how about using a 2nd adodc?
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old November 3rd, 2004, 12:07 AM
vmbs vmbs is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 36 vmbs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 24 sec
Reputation Power: 4
tanx

Yeah it worked with refresh
tahnx dough

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > How to change datagrid at Runtime


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 | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway