C# 使用gridview时引用不明确
我制作了一个C#程序,它允许我从Oracle数据库获取信息。现在我成功地在应用程序中显示了一行。我的下一个目标是将数据库信息放在gridview中,这也允许您单击它来激活一个函数。我想知道怎么做。我读了这篇文章,但我还是不知道怎么做 一开始它说C# 使用gridview时引用不明确,c#,winforms,gridview,C#,Winforms,Gridview,我制作了一个C#程序,它允许我从Oracle数据库获取信息。现在我成功地在应用程序中显示了一行。我的下一个目标是将数据库信息放在gridview中,这也允许您单击它来激活一个函数。我想知道怎么做。我读了这篇文章,但我还是不知道怎么做 一开始它说 Namespace: System.Windows.Controls Assembly: PresentationFramework (in PresentationFramework.dll) 现在我找到了参考PresentationFrame
Namespace: System.Windows.Controls
Assembly: PresentationFramework (in PresentationFramework.dll)
现在我找到了参考PresentationFramework
,并添加了它。然后我又加了一句
使用System.Windows.Controls
添加引用时,出现了一个错误:
Error 1 'UserControl' is an ambiguous reference between 'System.Windows.Forms.UserControl' and 'System.Windows.Controls.UserControl'
地址:
及
地址:
这里出了什么问题
这是实现我的下一个目标的正确方法吗?你看到的是错误的控制。你想要一个
请参阅“”您是在询问WPF、Windows窗体还是什么?我已编辑了您的标题。请看“”,其中的共识是“不,他们不应该”。@JohnSaunders好的,谢谢。顺便说一句,你能再解释一下为什么吗?为什么?因为您看到的是WPF“GridView”控件,而不是Windows窗体“GridView”控件。
public partial class DockableWindow : UserControl
{
Error 2 'ArcMapAddin28.DockableWindow' does not contain a definition for 'Handle' and no extension method 'Handle' accepting a first argument of type 'ArcMapAddin28.DockableWindow' could be found (are you missing a using directive or an assembly reference?)
protected override IntPtr OnCreateChild()
{
m_windowUI = new DockableWindow(this.Hook);
return m_windowUI.Handle; //red line under the word Handle
}