Failed to convert parameter value from pointer to string

I am at the end of my knowledge and was looking for an answer for an answer, but no luck: /

A week ago, everything worked well.

I did the reverse in the repository, recreated the table, etc ... nothing helped.

When I try to save in my application, I get a SystemInvalidCastException exception:

PersonListDataSet.cs:

partial class P_GroupTableAdapter
{
    public int Update(PersonListDataSet.P_GroupDataTable dataTable, string userId)
    {
        this.Adapter.InsertCommand.Parameters["@userId"].Value = userId;
        this.Adapter.DeleteCommand.Parameters["@userId"].Value = userId;
        this.Adapter.UpdateCommand.Parameters["@userId"].Value = userId;

        return this.Update(dataTable); **<-- Exception occurs here**
    }
}

Everything is stuck here because Guid - and I checked the datatable preview with the magnifier tool, which is really a true Guid in the data column - cannot be converted to a string ??? How can this happen?

+5
source share
2 answers

. userId , GUID:

 Parameters["@userId"].Value = new Guid(userId);

, UserId GUID. .

, :

, , select, :

SELECT ....
WHERE '{BB6DFF45-FDA7-4155-86D0-0CBF129A9104}' = `domainname\\jondoe`

, .

+6

:

this.Adapter.InsertCommand.Parameters["@userId"].Value = new Guid(userId);
this.Adapter.DeleteCommand.Parameters["@userId"].Value = new Guid(userId);
this.Adapter.UpdateCommand.Parameters["@userId"].Value = new Guid(userId);

, !!!

+2

All Articles