public string LabelSql_API() { M_APIResult retMod = new M_APIResult(M_APIResult.Success); string action = Request.Query["action"]; try { switch (action) { case "tables": //根据数据库获取表信息 { } break; case "fields": //根据当前选中的表,获取字段信息 { string dsname = RequestEx["dsname"]; string tbname = RequestEx["tbname"]; SqlBase db = B_DataSource.GetDSByType(dsname); DataTable dt = db.Field_List(tbname); dt.DefaultView.Sort = "Name"; retMod.result = JsonConvert.SerializeObject(dt); } break; } } catch (Exception ex) { retMod.retmsg = ex.Message; retMod.retcode = M_APIResult.Failed; } return(retMod.ToString()); }