I have created a table mytable in SQLCE which 2 colums col1 ,col2.
col1 = numeric,Length 5, Allow Nulls=No,Unique=No,Primary Key=Yes.
col2 = nvarchar,Length 35, Allow Nulls=No,Unique=No,Primary Key=No.
In my VS2008.Net3.5 VB code:
Dim outletInsertCmd As SqlCeCommand
outletInsertCmd.Parameters.Add("?", SqlDbType.Float, 9, "col1")-------------------
outletInsertCmd.Parameters.Add("?", SqlDbType.NVarChar, 35, "col2")--------------
Dim curOutletRow As DataRow
curOutletRow.Item("col1") =0 'This works fine
curOutletRow.Item("col2") ="ABA" ====Giving error as Format Exception.
--I think I am wrong in passing String from .Net to SQLCE. What should be the code.
I tried:curOutletRow.Item("col2") ="'ABA'"===Does not work
curOutletRow.Item("col2") =Convert.ToString("ABA")===Does not work
--Please help me. Thanks
col1 = numeric,Length 5, Allow Nulls=No,Unique=No,Primary Key=Yes.
col2 = nvarchar,Length 35, Allow Nulls=No,Unique=No,Primary Key=No.
In my VS2008.Net3.5 VB code:
Dim outletInsertCmd As SqlCeCommand
outletInsertCmd.Parameters.Add("?", SqlDbType.Float, 9, "col1")-------------------
outletInsertCmd.Parameters.Add("?", SqlDbType.NVarChar, 35, "col2")--------------
Dim curOutletRow As DataRow
curOutletRow.Item("col1") =0 'This works fine
curOutletRow.Item("col2") ="ABA" ====Giving error as Format Exception.
--I think I am wrong in passing String from .Net to SQLCE. What should be the code.
I tried:curOutletRow.Item("col2") ="'ABA'"===Does not work
curOutletRow.Item("col2") =Convert.ToString("ABA")===Does not work
--Please help me. Thanks