Converting Problem
Hi All
I have done one function in asp.net.
Ival.Insert(1, New DBValues("Diagnosis", Diagnosis, mod_commonFunctions.DataType.DString))
Ival is my arraylist.
For i = 0 To IValues.Count - 1
nvalues = IValues(i) 'the value of ith index is assgning to nvalues(here value is form of DBvalue'
ParamList = ParamList & ", @" & nvalues.ColumnName
ColumnList = ColumnList & "," & nvalues.ColumnName
Next
ParamList = Trim(Mid(ParamList, 2))
ColumnList = Trim(Mid(ColumnList, 2))
sqlcmd.CommandText = "INSERT INTO " & Tablename & " (" & ColumnList & ") VALUES (" & ParamList & ")"
sqlcmd.Transaction = Tran
With sqlcmd.Parameters
For i = 0 To IValues.Count - 1
Dim pParam As New SqlParameter
nvalues = IValues(i)
pParam.ParameterName = "@" & nvalues.ColumnName
pParam.Value = nvalues.ColumnValue
.Add(pParam)
Next
End With
sqlcmd.ExecuteNonQuery()
When i reach executenonquery,then i got error:"Error converting datatype nvarchar to numeric"
I am not understand How to solve this error?If u have soln pls solve it and give me ans.
Thanks
monika
|