By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,363 Members | 1,470 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,363 IT Pros & Developers. It's quick & easy.

Problem with Query

P: 39
I have the 2 sql tables


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 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
Share this Question
Share on Google+
1 Reply

Expert 5K+
P: 8,127
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.