Hi all,

I am facing below problem. Your help is really appreciated.

Cannot perform '=' operation on System.Int32 and System.String.

What I tried to do here is I have a dataset get from SQL Express 2005 and I am adding a new row to it and it hit the above error.

I combine 3 tables in SQL and return the data to my win application.
And I add 1 row to it.

Here is the data type in my sql statement.

Code:
SELECT cd.indexNo, c.custid, c.companyname, c.contactperson, c.contactno,
dt.Type, cdm.DrawingMaterial, cd.Size, cd.Roundness
FROM rpts_customer As c, rpts_custdiesdetail As cd, 
rpts_Type As dt, rpts_CustDrawMaterial As cdm
WHERE c.custID = cd.custID AND
cd.cdmNo = cdm.cdmNo AND
cd.dtNo = dt.dtNo AND
c.Active = 'TRUE'
ORDER BY dt.Type

indexNo = Integer (which is an auto increasement column in master table)
custID = Integer (same as indexNo, auto increase)
companyName = VarChar(50)
contactperson = VarChar(50)
contactno = VarChar(50)
Type = VarChar(50)
DrawingMaterial = VarChar(50)
Size = Numeric(10,6)
Roundness = Numeric(10,6)

dtNo = Int (auto increase)
cdmNo = Int (auto increase)
Active = Bit
And Here is my code in vb.net
VB.Net Code:
  1. Dim dRow As DataRow = dSet.Tables("tblCustDetail").NewRow
  2. dRow.Item(DBFN_IndexNo) = 1
  3. dRow.Item(DBFN_CustID) = txtCustID.Text.Trim
  4. dRow.Item(DBFN_CompanyName) = txtCompanyName.Text.Trim
  5. dRow.Item(DBFN_ContactPerson) = txtContactPerson.Text.Trim
  6. dRow.Item(DBFN_ContactNo) = txtContact.Text.Trim
  7. dRow.Item(DBFN_Type) = cboType.Text
  8. dRow.Item(DBFN_DrawingMaterial) = cboDrawingMaterial.Text
  9. dRow.Item(DBFN_Size) = txtSize.Text.Trim
  10. dRow.Item(DBFN_Roundness) = txtRoundness.Text.Trim
  11.  
  12. dSet.Tables("tblCustDetail").Rows.Add(dRow)

Anybody has any idea???
I'm out of solution. I checked the Database fields and its the same. No differences.
I don't know what should I do...

Help..

Thanks.
scsfdev