tags:

views:

45

answers:

1

Hello.

My linq to sql insert class don't give a error and don't insert and i can't find out why. When i test the code in LinqPad i did work.

        public void CreateRole(string Role)
    {

        Roles role = new Roles()
        {
            Title = Role,
        };


        data.Roles.InsertOnSubmit(role);

        try
        {
            data.SubmitChanges();
        }

        catch (Exception ex)
        {
            throw ex;
        }
    }

This is the class i have to insert my data. 'data' is get of my dbml file.

CreateRole("Users"); don't work.

I don't get any error and it don't insert. I can get data out of the database but not insert in any table.

A: 

I figure it out, the problem where that "data" is just get and not set.

Frozzare
Please accept this as your answer then so this question is removed from the `unanswered questions` list.
Peter