Showing posts with label button. Show all posts
Showing posts with label button. Show all posts

Tuesday, March 27, 2012

Error during sqlDataSource.Update() instruction

Hi, I have such a problem:

I try to update (or insert) a row in my table and i fail althought i,ve read many posts here. I.ve created a button and "on_click" event to this button and want that event to update or insert a record in my table. I wrote:

protected void selectButton_Click(object sender, EventArgs e)
{
String taskID = projectsGridView.SelectedRow.Cells[0].Text;
usersSqlDataSource.UpdateCommand = "update [Users] set [TaskID]=@.task where [UserID]=1";
usersSqlDataSource.UpdateParameters.Add("task", taskID);
usersSqlDataSource.Update();
}

The application creates error in the last line of code (usersSqlDataSource.Update();) and i receive such an error:

You have specified that your update command compares all values on SqlDataSource 'usersSqlDataSource', but the dictionary passed in for oldValues is empty.
Pass in a valid dictionary for update or change your mode to OverwriteChanges.
 
For me it looks like there is a problem while setting parameters. Shall i change some properties of the sqlDataSource or GridView? Please help.. 
 


Not seeing the code for your SqlDataSource, it's hard to tell. However, I suspect that you need to change the SqlDataSource.ConflictDetection property to OverwriteChanges instead of CompareAllValues.

|||

Yes!! It works!!!

The beginnings are difficult, thank you very much ;)

Wednesday, March 21, 2012

Error Creating Role on Cube

I am trying to create a role on a dimension and when I
click on the Test Role button, I get the following
error.
"Unable to process one or more commands. User-generated
error - the dimension "All Regions" has no valid member.
For more information, see your administrator."
Below is the mdx that I have entered on the All Regions
dimension of my role.
FILTER(
{[All Regions].[Region Name].Members},
(((STRTOTUPLE(MID(USERNAME,INSTR(1,USERNAME,"\")+1 ,128)),
[SFAccessre])=1)
AND ((STRTOTUPLE(MID(USERNAME,INSTR(1,USERNAME,"\")
+1,128)),[Cube Typere])=1)
AND ((STRTOTUPLE(MID(USERNAME,INSTR(1,USERNAME,"\")
+1,128)),[Dimension Typere])=1)))
I am able to browse the data of the All Regions
dimension. The dimensions SFAccessre, Cube Typere and
Dimension Typere are all in a Users Region dimension.
I use a similar MDX statement for security on another
dimension in my cube.
TIA
Hi,
When you execute the Test Role button, it takes in the Logged in User and
tries to apply the Security MDX on this. (Bascially the UserName function
would return the Logged in User's Information.)
Please check if the Logged in user has got corresponding records in the All
Regions Dimension.
Thanks,
Sanka
"Craig" wrote:

> I am trying to create a role on a dimension and when I
> click on the Test Role button, I get the following
> error.
> "Unable to process one or more commands. User-generated
> error - the dimension "All Regions" has no valid member.
> For more information, see your administrator."
> Below is the mdx that I have entered on the All Regions
> dimension of my role.
> FILTER(
> {[All Regions].[Region Name].Members},
> (((STRTOTUPLE(MID(USERNAME,INSTR(1,USERNAME,"\")+1 ,128)),
> [SFAccessre])=1)
> AND ((STRTOTUPLE(MID(USERNAME,INSTR(1,USERNAME,"\")
> +1,128)),[Cube Typere])=1)
> AND ((STRTOTUPLE(MID(USERNAME,INSTR(1,USERNAME,"\")
> +1,128)),[Dimension Typere])=1)))
> I am able to browse the data of the All Regions
> dimension. The dimensions SFAccessre, Cube Typere and
> Dimension Typere are all in a Users Region dimension.
> I use a similar MDX statement for security on another
> dimension in my cube.
> TIA
>

Error Creating Role on Cube

I am trying to create a role on a dimension and when I
click on the Test Role button, I get the following
error.
"Unable to process one or more commands. User-generated
error - the dimension "All Regions" has no valid member.
For more information, see your administrator."
Below is the mdx that I have entered on the All Regions
dimension of my role.
FILTER(
{[All Regions].[Region Name].Members},
(((STRTOTUPLE(MID(USERNAME,INSTR(1,USERN
AME,"\")+1,128)),
[SFAccessre])=1)
AND ((STRTOTUPLE(MID(USERNAME,INSTR(1,USERNA
ME,"\")
+1,128)),[Cube Typere])=1)
AND ((STRTOTUPLE(MID(USERNAME,INSTR(1,USERNA
ME,"\")
+1,128)),[Dimension Typere])=1)))
I am able to browse the data of the All Regions
dimension. The dimensions SFAccessre, Cube Typere and
Dimension Typere are all in a Users Region dimension.
I use a similar MDX statement for security on another
dimension in my cube.
TIAHi,
When you execute the Test Role button, it takes in the Logged in User and
tries to apply the Security MDX on this. (Bascially the UserName function
would return the Logged in User's Information.)
Please check if the Logged in user has got corresponding records in the All
Regions Dimension.
Thanks,
Sanka
"Craig" wrote:

> I am trying to create a role on a dimension and when I
> click on the Test Role button, I get the following
> error.
> "Unable to process one or more commands. User-generated
> error - the dimension "All Regions" has no valid member.
> For more information, see your administrator."
> Below is the mdx that I have entered on the All Regions
> dimension of my role.
> FILTER(
> {[All Regions].[Region Name].Members},
> (((STRTOTUPLE(MID(USERNAME,INSTR(1,USERN
AME,"\")+1,128)),
> [SFAccessre])=1)
> AND ((STRTOTUPLE(MID(USERNAME,INSTR(1,USERNA
ME,"\")
> +1,128)),[Cube Typere])=1)
> AND ((STRTOTUPLE(MID(USERNAME,INSTR(1,USERNA
ME,"\")
> +1,128)),[Dimension Typere])=1)))
> I am able to browse the data of the All Regions
> dimension. The dimensions SFAccessre, Cube Typere and
> Dimension Typere are all in a Users Region dimension.
> I use a similar MDX statement for security on another
> dimension in my cube.
> TIA
>