From: woody l. <got...@ma...> - 2005-03-31 13:42:50
|
Hello, Like so many others, I'm trying MSVC# after using Delphi since v1. I'm pleased with the relatively simplicity, thus far, in getting Firebird .Net Provider working in MSVC#. I have a test project. It has a FBConnection that passes the test to the local database; an FBDataAdapter whose select statement does a 'select * from companies', which seems to work alright. I used the FBDataAdapter's Actions to Generate a Dataset and clicked the checkbox for 'Use DataAdapter Select Command'. (I tried selecting individual tables in the list of tables within the Generate a Dataset wizard, but I get an error message saying 'Table Unknown: COMPANIES'. It looks as though the Generate Dataset wizard isn't adding quotation-marks when tables are selected). Anyway, so a Dataset (DataSet1) is created in my project. DataSet1 has a Collection field called Tables. The collection has a single item that corresponds to the table selected using the FBDataAdapter's select statement. I know this because if I click edit the Columns Collection that corresponds DataSet1.Tables[0].Columns, I see all the Columns from my 'Companies' table. I then add a DataGridView component to my Windows Form, and set its DataSource property to DataSet1. I set DataGridView.DataMember to 'Companies', which corresponds to DataSet1.Tables[0].TableName and which I pick using a convienient drop-down list of tables. The DataGridView in my forum updates to show all of the columns in the Firebird table. I do not see any Data, but I saw an earlier message that indicated that live data in the designer is not yet supported. When I run the application in order to see the table's data in the DataGridView, I get an error during the building: ----- Error 1 Cannot implicitly convert type 'System.Data.DataTableCollection' to 'System.Data.DataTable' C:\Documents and Settings\...\Form1.Designer.cs 248 17 ----- This is the code that was generated automatically that the error refers to: ----- this.dataSet2.Tables.AddRange(new System.Data.DataTable[] { ((System.Data.DataTableCollection)(resources.GetObject("dataSet2.Tables"))) }); ----- Any hints or ideas about what's wrong? Thanks! -Woody |