Problem with Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • suganya
    New Member
    • Dec 2006
    • 39

    Problem with Query

    I have the 2 sql tables

    DoctorMaster

    DRID nvarchar(50)
    FirstName nvarchar(100)
    LastName nvarchar(100)
    Gender bit
    Address1 nvarchar(255)
    Address2 nvarchar(255)
    City nvarchar(100)
    Country nvarchar(100)
    SpecialityId nvarchar(100)

    Speciality

    SPIDnvarchar(12 )
    Speciality vnarchar(50)


    I have 2 dropdownlist boxes & 1 textbox in my webpage. Based on the dropdownlist boxes & textbox I have to select the Name, Speciality & Suffix from the DB.


    the query I have given is

    "select dm.FirstName||d m.LastName "Name",sp.Speci ality,dm.Suffix from DoctorMaster dm,Speciality sp where sp.SPID=dm.Spec ialityID and dm.Country='" + ddlCountry.Sele ctedItem.Text.T oString() + "' or sp.Speciality=' " + ddlDisease.Sele ctedItem.Text.T oString() + "' or dm.FirstName||d m.LastName "Name" like '" + txtName.Text + "%'";

    can anybody give me the right query
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    what you want to select from the tables ?

    Comment

    Working...