Linq for Dummies

Posts   
 
    
Daniel B
User
Posts: 3
Joined: 03-Oct-2008
# Posted on: 03-Oct-2008 10:27:08   

Hi,

I have just got in touch with the LLBLGen Pro product and want to learn more about it. But I have never used Linq and want to find a fast way to learn more about these functions. Is there any site or book that you can recommend? I use VB.Net When I started to use LLBLGen I easilly cold read data but when I tried to update, insert or delete, I didn't succed. I have a new project comming up and it would be great to use LLBLGen from the beginning.

//Daniel B

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 03-Oct-2008 11:16:31   

First thing to note is that LINQ is for reading data, not for Updating, Inserting or Deleting.

If you didn't use Linq for inerts/updates/deletes, would you please post what have you been trying?

Daniel B
User
Posts: 3
Joined: 03-Oct-2008
# Posted on: 03-Oct-2008 11:32:09   

On a Click Event in ASP.Net I had a command that Inserts data by a SqlDataSource, now I want to use LLBLGenProDataSource2 or code that uses LLBLGen genereted scripts instead;

Protected Sub AddGroupButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles AddGroupButton.Click

    Me.GroupNameSql.Insert()
    ddlGroups.Items.Clear()
    ddlGroups.Items.Add("Choose a group...")
    Me.ManageGroupsGridView.DataBind()
    Me.AddGroupTextBox.Text = ""

End Sub

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 03-Oct-2008 11:49:55   

Could you please consult the documentation manual for how to use entities under Using the Generated Code (Adapter or SelfServicing).

It should be like this:

MyEntity myEntity = new MyEntity(); myEntity.Field1 = xyz; // fill more fields

// in adapter you'd do the following DataAccessAdapter adapter = new DataAccessAdapter(); adapter.SaveEntity(myEntity);

// in selfServicing you'd do the following myEntity.Save();

Daniel B
User
Posts: 3
Joined: 03-Oct-2008
# Posted on: 03-Oct-2008 12:57:28   

Thank you for helping. I will read the documentation.

//Daniel B