none
Datagridview red cross error RRS feed

  • Question

  • Hi Friends,

    when binding data to the data grid view it displays a red cross... I found that the datasource contains the data that needs to be binded but it displays the red cross error..... any pointers regarding the issue pls help me out....

    Stack Trace for the issue

       at System.Data.BinaryNode.SetTypeMismatchError(Int32 op, Type left, Type right)
       at System.Data.BinaryNode.BinaryCompare(Object vLeft, Object vRight, StorageType resultType, Int32 op)
       at System.Data.BinaryNode.EvalBinaryOp(Int32 op, ExpressionNode left, ExpressionNode right, DataRow row, DataRowVersion version, Int32[] recordNos)
       at System.Data.BinaryNode.Eval(DataRow row, DataRowVersion version)
       at System.Data.DataExpression.Invoke(DataRow row, DataRowVersion version)
       at System.Data.Index.AcceptRecord(Int32 record, IFilter filter)
       at System.Data.Index.ApplyChangeAction(Int32 record, Int32 action)
       at System.Data.DataTable.RecordStateChanged(Int32 record1, DataViewRowState oldState1, DataViewRowState newState1, Int32 record2, DataViewRowState oldState2, DataViewRowState newState2)
       at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Int32 position, Boolean fireEvent, Exception& deferredException)
       at System.Data.DataTable.InsertRow(DataRow row, Int32 proposedID, Int32 pos, Boolean fireEvent)
       at System.Data.DataRowCollection.Add(DataRow row)
       at Healix.RMS.Data.CaseDataSet.MedicationDataTable.AddMedicationRow(Int64 OrderID, String DrugID, String Drug, String Dose, String DrugDose, String Frequency, String DeliveryDevice, String Duration, String SchStartDate, String Category, String PlaceOfService, String AncillaryMeds, String Notes, String Status, String MailStatus, String Route, String ActStartDate, String AuthDays, String EndDate, String AuthStartDate, String AuthEndDate, String ICD9Code, String ICD9Desc, String GenericDrugCode, Boolean HCPS, String ClinicalOrderDesc, String TradeName, Boolean PrimaryCarePlan, String Medication, Boolean SplitCase, String EstimatedShippingCost, String PatientTheraphyState) in C:\Documents and Settings\Administrator\Desktop\RMS.Client\RMS.Client\RMS.Data\CaseDataSet.cs:line 1670
       at Healix.RMS.App.frmDetailReferrals.frmDrug_returnDrug(String Drug, String DrugID, String TradeName, String Category) in C:\Documents and Settings\Administrator\Desktop\RMS.Client\RMS.Client\RMS.App\frmDetailReferrals.cs:line 10543

    Thanks in advance.....

    Rajkumar.R

    Thursday, April 19, 2012 12:53 PM

Answers

  • Hi, 

    This could be the reason there is a type mismatch, check with passing parameter type matches to datagridcolumn datatype.

    Hope this helps you...


    If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".

    Thursday, April 19, 2012 5:59 PM
  • Hello,

    I am getting this same error (but int32) trying to do a simple assignment from one table to another in the dataset. This is happening in code that has been deployed for over a year and never received any error. Both fields are type string. I don't understand why it is even doing a binary compare since it is an assignment.

    Simple code: r.txtNAICS = rmar.CodeDescr;

    Could a Framework update have broken this?

    Exception at System.Data.BinaryNode.BinaryCompare(Object vLeft, Object vRight, StorageType resultType, Int32 op)

    Thanks!

    Update. I got this working, but how made no sense to me, I'll put it out there as something to look at.

    In a separate method, I was using a DataView filtered ion the field in question, I did not have delimited, so it treated it like an int. No big deal I thought. The DataView was disposed of, then the row was used in the next method, but it now thought it was an int32, even though the debugger still said it was a String.

    The question here is, why would a DataView, only used for reading values, affect the system data type of the underlying recordset? Especially after the view is disposed?

    broken: 

    DataView dv = new DataView(_dsNAICS.tNotes, "txtNAICS = " + sr.txtNAICS, "", DataViewRowState.CurrentRows);

    works:

    DataView dv = new DataView(_dsNAICS.tNotes, "txtNAICS = '" + sr.txtNAICS + "'", "", DataViewRowState.CurrentRows);

    Tuesday, April 24, 2012 8:04 PM

All replies

  • Hi,

    do you have a column in your datatable with an expression? Could it be that the expression is in error?


    Regards, Nico

    Thursday, April 19, 2012 12:57 PM
  • Hi...

    Thanks for Reply...expression Means? I didnt get..

    Thursday, April 19, 2012 3:25 PM
  • a rowfilter expression for a dataview, or a datacolumn expression.

    Regards, Nico

    Thursday, April 19, 2012 4:08 PM
  • Hi Nico,

    i am not using that expression. i got that error in 2 scenarios

    1.when add data into dataset 

    Ex: dstCaseGlobal.Medication.AddMedicationRow(OrderId, DrugID, Drug, "", "", "", "", "", "", Category, "", "", "", "H", "N", "", "", "", "", "", "", "", "", "", false, clinicalOrderDesc, TradeName, false, "", false, "", "");

    2 Load the String Reader into Dataset

    The Error Message is "Cannot perform '=' operation on System.Int64 and System.String."

    Kindly Let me know your Feedback.

    Thursday, April 19, 2012 5:48 PM
  • Hi, 

    This could be the reason there is a type mismatch, check with passing parameter type matches to datagridcolumn datatype.

    Hope this helps you...


    If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".

    Thursday, April 19, 2012 5:59 PM
  • Hello,

    I am getting this same error (but int32) trying to do a simple assignment from one table to another in the dataset. This is happening in code that has been deployed for over a year and never received any error. Both fields are type string. I don't understand why it is even doing a binary compare since it is an assignment.

    Simple code: r.txtNAICS = rmar.CodeDescr;

    Could a Framework update have broken this?

    Exception at System.Data.BinaryNode.BinaryCompare(Object vLeft, Object vRight, StorageType resultType, Int32 op)

    Thanks!

    Update. I got this working, but how made no sense to me, I'll put it out there as something to look at.

    In a separate method, I was using a DataView filtered ion the field in question, I did not have delimited, so it treated it like an int. No big deal I thought. The DataView was disposed of, then the row was used in the next method, but it now thought it was an int32, even though the debugger still said it was a String.

    The question here is, why would a DataView, only used for reading values, affect the system data type of the underlying recordset? Especially after the view is disposed?

    broken: 

    DataView dv = new DataView(_dsNAICS.tNotes, "txtNAICS = " + sr.txtNAICS, "", DataViewRowState.CurrentRows);

    works:

    DataView dv = new DataView(_dsNAICS.tNotes, "txtNAICS = '" + sr.txtNAICS + "'", "", DataViewRowState.CurrentRows);

    Tuesday, April 24, 2012 8:04 PM
  • a rowfilter expression for a dataview, or a datacolumn expression.

    Regards, Nico

    hi, 

    what is the type of the field in the database? has it changed recently? Such errors are difficult to find if you call your fields 'txtNAICS' while it is an integer. If the datatype of the field does not correspond (anymore) with the type in the database, you'll have to modify the type in the dataset.


    Regards, Nico

    Wednesday, April 25, 2012 6:41 AM