inserting with my own adapter

Posts   
 
    
mohamed avatar
mohamed
User
Posts: 136
Joined: 10-Mar-2008
# Posted on: 10-Apr-2008 11:16:01   

dear all i have n teir application in UI i use llblgendatasource ,gridview, 1 textbox and button save when clicking save goesto add record in database and bind again to grid in save button did that

        var toSave = new CODECityEntity();
        toSave.ENLongDescription = txtCityLongEnglishName.Text;

//call my method to save mySave(toSave); // binding to grid grid.databing();

protected void dsCity_PerformSelect(object sender, PerformSelectEventArgs2 e)
    {
        myClass.GetCityList(e.ContainedCollection, e.Filter);
    }

my problem is the new record didn't apper how to solve this

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 10-Apr-2008 11:24:43   

my problem is the new record didn't apper

Was it saved in the database? Was the performSelect called?

mohamed avatar
mohamed
User
Posts: 136
Joined: 10-Mar-2008
# Posted on: 10-Apr-2008 11:26:32   

yes it saved in database and didn't call performSelect

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 10-Apr-2008 11:54:24   

I guess that's because you didn't use the LLBLGenProDataSource for saving the new entity, that's why it doesn't have a clue that the underlying data has changed that's why it doen't re-fetch it.

Try the following:

grid.DataSource = myLLBLGenPrDataSource;
grid.databing();
mohamed avatar
mohamed
User
Posts: 136
Joined: 10-Mar-2008
# Posted on: 10-Apr-2008 12:11:18   

it didn't work also let us do it from myllbldatasource but in UI doesn't have access for adapter i only have mysave method to save data

how can implement this

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 10-Apr-2008 12:40:35   

Would you please try to call the DataSource.Select() method.

mohamed avatar
mohamed
User
Posts: 136
Joined: 10-Mar-2008
# Posted on: 10-Apr-2008 12:55:11   

i do myllbldatasource.Refetch = true;

and it success

but i want to know what is senario for using myllbldatasource insertParameter where can i put mysave methoud()

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 10-Apr-2008 15:41:09   

Before using Insert parameters, you should be doing the insert from the databound control. Which should call the LLBLGenProDataSource internal ExecuteInsert method.

Then you can specify InsertParameters to be considered when inserting.

mohamed avatar
mohamed
User
Posts: 136
Joined: 10-Mar-2008
# Posted on: 10-Apr-2008 15:56:55   

this is thing that i want how to call insert from llbldatasource and pass mySvae method

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 10-Apr-2008 16:25:56   

You can't it should be called internally from the databound control.

mohamed avatar
mohamed
User
Posts: 136
Joined: 10-Mar-2008
# Posted on: 10-Apr-2008 17:07:00   

ok

Thanx