| 1. |
Why Do I Get The Error Message "object Must Implement Iconvertible". How Can I Resolve It? |
|
Answer» The COMMON cause for this error is SPECIFYING a control as a SqlParameter's Value instead of the control's text value.For example, if you write CODE as below you'll get the above error: VB.NET DIM nameParameter As SqlParameter = command.Parameters.Add ("@name",SqlDbType.NVarChar,50) C# SqlParameter nameParameter = command.Parameters.Add("@name", SqlDbType.NVarChar, 50); To resolve it, SPECIFY the control's Text property instead of the control itself. VB.NET nameParameter.Value = txtName.Text C# nameParameter.Value =txtName.Text; The common cause for this error is specifying a control as a SqlParameter's Value instead of the control's text value.For example, if you write code as below you'll get the above error: VB.NET Dim nameParameter As SqlParameter = command.Parameters.Add ("@name",SqlDbType.NVarChar,50) C# SqlParameter nameParameter = command.Parameters.Add("@name", SqlDbType.NVarChar, 50); To resolve it, specify the control's Text property instead of the control itself. VB.NET nameParameter.Value = txtName.Text C# nameParameter.Value =txtName.Text; |
|