Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
rabail684
Starting Member
8 Posts |
Posted - 2007-04-24 : 05:39:52
|
SqlDataAdapter da2 = new SqlDataAdapter("SELECT Personal.NumberofBeds FROM Personal WHERE Personal.HospitalID==Patients.HospitalID AND Personal.HospitalName==PName", con);i've an application built in c#.net and connected with sql server 2005's database,so executing this command it gives exception as invalid syntax...WHAT'S rong with this query? PName is a string taken as this ::SqlDataAdapter da = new SqlDataAdapter("select HospitalName,Totalpatients from Patients", con);DataSet ds = new DataSet();da.Fill(ds,0,0,"Patients");SqlCommandBuilder cb = new SqlCommandBuilder(da);string PName=System.Convert.ToString(ds.Tables["Patients"].Rows[ii]["HospitalName"]);someone may also tell me Please that in this current scenario,,whts the best way to select data from multiple tables based on some clauses? |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
|
|