469,898 Members | 1,547 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

Problem with Query

39
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||dm.LastName "Name",sp.Speciality,dm.Suffix from DoctorMaster dm,Speciality sp where sp.SPID=dm.SpecialityID and dm.Country='" + ddlCountry.SelectedItem.Text.ToString() + "' or sp.Speciality='" + ddlDisease.SelectedItem.Text.ToString() + "' or dm.FirstName||dm.LastName "Name" like '" + txtName.Text + "%'";

can anybody give me the right query
Jun 17 '08 #1
1 885
debasisdas
8,127 Expert 4TB
what you want to select from the tables ?
Jun 18 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

20 posts views Thread by Development - multi.art.studio | last post: by
3 posts views Thread by Juan Antonio Villa | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.