1

I want to pass a column name and value to a function that will update a table using LINQ.

I have the code below but don't know how to implement the string variable column name

private static void update(string key, string value)
    {
        AccessToken accessToken = new AccessToken();

        accessToken.<key variable should go here> = value;

        QBAccessTokensDataContext db = new QBAccessTokensDataContext();
        db.AccessTokens.InsertOnSubmit(accessToken);
        db.SubmitChanges();

    }
Shazoo
  • 685
  • 12
  • 25

1 Answers1

0

Add one more property to your class AccessToken with Key name and store the value

karthik kasubha
  • 392
  • 2
  • 13