Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Retrieval of data from mulit table from SQL server and load into datagrid

Retrieval of data from mulit table from SQL server and load into datagrid

Scheduled Pinned Locked Moved Database
databasecsharpsql-serversysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    blueei
    wrote on last edited by
    #1

    :(( 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! :-O 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() '''''''''''''''''''''''''''''''''''''''''''''''''''''':rose:

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups