SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL 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 ASP Free Forums Sponsor:
  #1  
Old December 6th, 2001, 10:36 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Retrieval of data from mulit table from SQL server and load into datagrid

Originally posted by : blueei (blueei@hotmail.com)hilo, i'm a newbie at VB.NET... and i've wrote in VB.NET i've been trying examples from reference books and online reference... but it seems that i either got the syntax wrong or just could not get it right, i think that i have something somewhere wrong with the Join table part. as i have to use 3 different tables to get the result. anyone, pls help out... thank you! veri veri much! my syntax are as follows... '''''''''''''''''''''''''''''''''''''''''''''''''' Dim objDataSet As New DataSet("ValidReasonList") Dim cnn As SqlConnection Dim cmd As SqlDataAdapter Dim sql As String Dim tblValidReasons As New DataTable("ValidReasons") cnn = New SqlConnection("server=(local); database=sas2000; Integrated Security=SSPI") sql = "SELECT A.APPROVED, B.ADMNO, B.DATEFROM, B.DATETO, B.REASON_DESC, C.REASONTYPE_NAME" sql = sql & "FROM ABSENCE A, ABS_REASON B, ABS_REASON_TYPE C" sql = sql & "WHERE A.REASON_ID = B.REASON_ID AND B.REASONTYPE_ID = C.REASONTYPE_ID" sql = sql & "ORDER BY B.ADMNO" cmd = New SqlDataAdapter(sql, cnn) cmd.Fill(objDataSet, "JoinTable") dgValidReasons.DataSource = objDataSet.Tables("JoinTable").DefaultView dgValidReasons.DataBind() ''''''''''''''''''''''''''''''''''''''''''''''''''

Reply With Quote
  #2  
Old December 11th, 2001, 01:06 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Originally posted by : duno (duno@hotmail.com)------------blueei at 12/6/2001 8:36:37 PMhilo, i'm a newbie at VB.NET... and i've wrote in VB.NET i've been trying examples from reference books and online reference... but it seems that i either got the syntax wrong or just could not get it right, i think that i have something somewhere wrong with the Join table part. as i have to use 3 different tables to get the result. anyone, pls help out... thank you! veri veri much! my syntax are as follows... '''''''''''''''''''''''''''''''''''''''''''''''''' Dim objDataSet As New DataSet("ValidReasonList") Dim cnn As SqlConnection Dim cmd As SqlDataAdapter Dim sql As String Dim tblValidReasons As New DataTable("ValidReasons") cnn = New SqlConnection("server=(local); database=sas2000; Integrated Security=SSPI") sql = "SELECT A.APPROVED, B.ADMNO, B.DATEFROM, B.DATETO, B.REASON_DESC, C.REASONTYPE_NAME" sql = sql & "FROM ABSENCE A, ABS_REASON B, ABS_REASON_TYPE C" sql = sql & "WHERE A.REASON_ID = B.REASON_ID AND B.REASONTYPE_ID = C.REASONTYPE_ID" sql = sql & "ORDER BY B.ADMNO" cmd = New SqlDataAdapter(sql, cnn) cmd.Fill(objDataSet, "JoinTable") dgValidReasons.DataSource = objDataSet.Tables("JoinTable").DefaultView dgValidReasons.DataBind() '''''''''''''''''''''''''''''''''''''''''''''''''' must have been the sql statement...

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Retrieval of data from mulit table from SQL server and load into 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 5 hosted by Hostway
Stay green...Green IT