Odd Even Strange
2017-10-03T10:29:10Z
Datatype in MS SQL: [Quantity] DECIMAL (18, 6) NULL,
iGrid: Unbound mode.
C# in Visual Studio 2017.

Data from MS SQL to iGrid works well.

Generate columns, set the ValueTypes to what they are in SQL. nvarchar, int32 and Decimal(18,6). The Decimal fields in iGrid comes in with six decimals.

Problem? Saving data from iGrid to MS SQL results in: System.Data.SqlClient.SqlException "Error converting data type nvarchar to numeric."

At first glance this is just 'trying to input data into the wrong database field' - but no. Going into iGrid and copying the Decimal values into their own cells results in everything working fine. Write "22,22" or something in them all and everything works fine. What is the actual problem here?

a) Is there, for example, some way to tell the iGrid cell that it should use Decimal(18,6) instead of some generic 'Decimal' type? Would there be any point in doing so?
b) Can one get better (or more elaborate) error descriptions somehow?
c) This is just test code, even the database definitions are a bit up in the air, but still, I just recently started with C#. It probably shows. If there are any obviously better ways to do stuff, please do feel free to elaborate.


Igor/10Tec
2017-10-03T15:11:21Z
The error message you encounter comes from the .NET Framework (ADO.NET), but not from our iGrid. This happens not inside iGrid and we can't change that. In fact, this error tells us that it seems you try to store a text value in a numeric field. Have you checked this?

As for storing values in iGrid cells, they are stored "as is" (i.e. in the format you put them into cells). Every iGrid cell value has the Object data type and can store any data type you can use in .NET. However, note that not all SQL data types can be represented with a corresponding .NET data type, and sometimes this may cause problems of data compatibility between the two worlds.

FYI: iGrid has the FillWithData method you can use to upload an ADO.NET data source into the grid with one call.
Odd Even Strange
2017-10-04T10:22:12Z
So, something like this?



Could not see any ways to use the ADO.NET Data Sources directly in fGrid.FillWithData, so there is probably something I've overlooked.

Test results just to show the data with a lowend laptop, 38 columns and about 935 000 rows of data:
DataGridView (bound): 76 seconds
Igrid (unbound input, input item by item, row by row): 27 seconds
Igrid (unbound input, FillWithData): 17 seconds
Igor/10Tec
2017-10-04T14:13:45Z
FillWithData expects a DataTable, DataView, IDbCommand or IDataReader object. Did you mean something else?