mahmud_uk

mahmud_uk

  • NA
  • 48
  • 0

Retriving data from database

Sep 2 2004 12:11 PM
I have two database, where a JOINT function is called to retrive data. From one of the database i am able to retrive data. In both database i have a felds which is same. Now i'm able to retrive that field from one database, but find it hard to retrive the data from the other database. Heres the code: String sQuery = "SELECT * FROM License L, LicenseGroup LG WHERE L.LicenseGroupID = LG.LicenseGroupID AND L.Name = '"+ label1.Text +"' AND L.LicenseGroupID = '"+ label2.Text +"'"; SqlCommand cmd = new SqlCommand(sQuery, con); con.Open(); SqlDataReader dr = cmd.ExecuteReader(); if( dr.Read() ) { label25.Text = dr[ "Name"].ToString(); label26.Text = dr[ "Name" ].ToString(); label27.Text = dr[ "Description" ].ToString(); label29.Text = dr[ "price" ].ToString(); label36.Text = dr[ "playcount" ].ToString();} Label25 Name needs to be retrived from the LicenseGroup table, while label26 is retrive from License table. I'm finding it hard to retrive data from LicenseGroup in label25. Does any one knows what amendmend i need to make. Thanks Mac

Answers (5)