出于某种原因,我可以从我的数据库中循环出每个表,除了这个特定的表。当我启动我的应用程序时,它立即崩溃了这个错误"路径包含一个空的部分"因为我正在初始化我的"检索数据"功能直接。所以这就是我如何循环它,我在日志中得到的结果就好了。
foreach (var currentItem in getItems["results"]) {
theName = currentItem ["name"].ToString ();
}
然后我试图通过做这样的事情来解决它:
if (Path != null) { //when I try to solve it like this then I get the error: System.IO.Path is a type but a variable was expected.
//i work with pins and the pins are alrdy added just fine. it is just this code below that is the issue.
pin.SetBinding (Label.TextProperty, new Binding (theName));
pin.BindingContext = theName;
//this is where I get the error/crash. if I write my own text, for example "test" instead it runs and also if i do pin.Label = theName; So the setbinding/bindingcontext does not seem to like the data iam trying to connect it with.
}
当我在日志中循环结果时,我得到的每个项目都非常好,所以我到达数据我检索数据,我收到的信息是标准文本,"",点等
当我谷歌问题和特别是问题"路径包含空白部分"我看不到以前的线程。所以我现在很困惑。
这是我通过httprequests检索数据的方式:
static public async Task<JObject> getInfo ()
{
var httpClientRequest = new HttpClient ();
var result = await httpClientRequest.GetAsync ("localhost");
var resultString = await result.Content.ReadAsStringAsync ();
var jsonResult = JObject.Parse (resultString);
return jsonResult;
}