var g_id = context.Request["g_id"]; DataTable dt = new DataTable(); var sql = @"select a.g_name ,c.cl_name ,c.cl_type ,c.cl_hidden ,c.grid_inner_order ,c.editor ,c.sum_able ,q.f_name ,q.f_type from tbl_grid a --列 left join tbl_grid_column_mapping b on a.g_id=b.g_id LEFT JOIN tbl_column c on c.cl_id=b.cl_id --filed left join tbl_column_field_mapping w on w.cl_id=b.cl_id left join tbl_field q on q.f_id= w.f_id where a.g_id='" + g_id+"'"; try { dt = dataprovider.FillDataTable(sql, CommandType.Text); string grid_name = dt.Rows[0]["g_name"].ToString(); var column = dt.AsEnumerable().Select(n => new { key = n.Field<string>("f_name"), value = n.Field<string>("cl_name") }).ToList(); context.Response.Write("{"g_name": " + grid_name + ","column":" + JsonConvert.SerializeObject(column) + "}"); } catch (Exception e) { context.Response.Write("失败:" + e.Message); }