Whenever I try to run my WPF application (window1.xaml) I get the following error :
"Cannot create instance of 'Window1' defined in assembly 'C1WPFGrid, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation. Error in markup file 'Window1.xaml' Line 1 Position 9. "
Why is this occuring ?
Also when I use 'namespace' in code behind file (window1.xaml.vb) the Initialize Component gives an error :
"Name 'InitializeComponent' is not declared" I have also given the code below:
Namespace C1DataGrid1
Partial Public Class Window1Inherits System.Windows.WindowPublic Sub New()
InitializeComponent()
Dim ProdTBL As New DataTableDim OleDBConnection As OleDb.OleDbConnection
Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\ComponentOneStudio.NET 3.0\Common\Nwind.mdb"OleDBConnection = New OleDb.OleDbConnection(connString)
Dim query As String
query =
"SELECT ProductID, ProductName,UnitPrice FROM Products"Using conn As New OleDb.OleDbConnectionDim da As New OleDb.OleDbDataAdapter(query, conn)
da.Fill(ProdTBL)
Dim CIGrid As C1.WPF.C1DataGrid.C1DataGrid = TryCast(Me.FindName("C1DataGrid1"), C1.WPF.C1DataGrid.C1DataGrid)
CIGrid.ItemsSource = ProdTBL
End Using
DataContext = ProdTBL
End Sub
Private _productsDataSet As ProductsDS = NothingPublic ReadOnly Property ProductsDataSet() As ProductsDS
Get
If _productsDataSet Is Nothing Then_productsDataSet = New ProductsDSDim prodTA As New ProductsTableAdapter
prodTA.Fill(_productsDataSet.Products)
End IfReturn _productsDataSet
End Get
End PropertyEnd Class
End
Namespace
PLEASE HELP !!!
Regards ......... Happyarimaan
Be who you are and say what you feel, because those who mind don't matter
and those who matter don't mind.