Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用xaml中的数据绑定显示数据库输出_C#_Wpf_Database_Xaml_Database Connection - Fatal编程技术网

C# 使用xaml中的数据绑定显示数据库输出

C# 使用xaml中的数据绑定显示数据库输出,c#,wpf,database,xaml,database-connection,C#,Wpf,Database,Xaml,Database Connection,我的XAML代码中的数据绑定存在重大问题 我要做的是得到一个数据库视图,由绑定填充。尽管我所能做的一切都是徒劳的 因此,在我的DatabaseView.xaml中,我有以下内容: <DataGrid ItemsSource="{Binding Path=patView}" /> 为完整起见,SelectAll位于querys.cs文件中,该文件包含 public static string SelectAll = "SELECT * FROM PatData"; 我真的很难让数据

我的XAML代码中的数据绑定存在重大问题

我要做的是得到一个数据库视图,由绑定填充。尽管我所能做的一切都是徒劳的

因此,在我的
DatabaseView.xaml中,我有以下内容:

<DataGrid ItemsSource="{Binding Path=patView}" />
为完整起见,
SelectAll
位于
querys.cs
文件中,该文件包含

public static string SelectAll = "SELECT * FROM PatData";

我真的很难让数据库使用这种绑定方法进行实际填充,非常感谢您的帮助。我将用您需要知道的更多代码编辑此文件:)

您是否收到任何输出错误?一个也没有。但是
PatientView
方法有0个引用,如果我放了一个断点,它就永远达不到。如果它不调用它,那么它就看不到它,因此应该有一个输出错误40:说它找不到patView。我所能做的就是使用resharper,它说由于未知的dataContext无法解析符号patView您设置了dataContext吗?
public static string SelectAll = "SELECT * FROM PatData";