Line 1: Incorrect syntax near 'clinicMainsurgery'. (exception occur)

Dec 17 2011 9:01 AM
hello;

there is exception occur by this name -->Line 1: Incorrect syntax near 'clinicMainsurgery'. i also mention color area of exception in the code. 



protected void Page_Load(object sender, EventArgs e)
 {


            SqlCommand cmd = new SqlCommand("select s.[surgery id],s.[patient surgery id],s.[surgery name],s.[surgery type id],s.[type name],s.[charges],s.[pv id],s.[patient visit charges] from 'clinicMainsurgery' s inner join 'surg' su on su.[surgery id]=s.[surgery id] inner join  'patientsurgery' ps on ps.[patient surgery id]=s.[patient surgery id]");
            cmd.Connection = Connection.get();
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();
            da.SelectCommand = cmd;
            da.Fill(ds);
            GridView_surgery.DataSource = ds;
            GridView_surgery.DataBind();
            //if (!IsPostBack)
            //{
            //    load_grid();
            //} 
        }

regards
sumaira manzoor

Answers (7)