PDA

View Full Version : [CLOSED] {success:false,message:"Access is denied."}



canusr1
Aug 19, 2013, 3:34 AM
Hello!

I have a grid panel and there is Import/ Export function.

If I imported thousand records and save the records, then I've got the following error message.

6774

When I debug, actually it even does not fire "SaveClick" event.

If I imported a few records less than a thousand, "SaveClick" event is fire and everything is working fine.

Could you advise what could be root cause for the issue?

Thank you.


<ext:Button ID="btnSave" runat="server" Text="Save & ReCalculate" Icon="Disk" Hidden="false">
<DirectEvents>
<Click OnEvent="SaveClick" Before="return #{sTransaction}.isDirty();">
<ExtraParams>
<ext:Parameter Name="data" Value="#{sTransaction}.getChangedData()" Mode="Raw" Encode="true"/>
<ext:Parameter Name="Values" Value="#{gvTransactionList}.getRowsValues()" Mode="Raw" Encode="true" />
</ExtraParams>
</Click>
</DirectEvents>
<Listeners>
<Click Handler="#{gvTransactionList}.editingPlugin.completeEdit();" />
</Listeners>
</ext:Button>

Baidaly
Aug 19, 2013, 8:16 AM
Hello!

It seems that your DirectEvent handler throws an error. Can you provide the DirectEvent handler to investigate?

canusr1
Aug 19, 2013, 8:38 AM
Hello!

I have a grid panel and there is Import/ Export function.

If I imported thousand records and save the records, then I've got the following error message.

6774

When I debug, actually it even does not fire "SaveClick" event.

If I imported a few records less than a thousand, "SaveClick" event is fire and everything is working fine.

Could you advise what could be root cause for the issue?

Thank you.


<ext:Button ID="btnSave" runat="server" Text="Save & ReCalculate" Icon="Disk" Hidden="false">
<DirectEvents>
<Click OnEvent="SaveClick" Before="return #{sTransaction}.isDirty();">
<ExtraParams>
<ext:Parameter Name="data" Value="#{sTransaction}.getChangedData()" Mode="Raw" Encode="true"/>
<ext:Parameter Name="Values" Value="#{gvTransactionList}.getRowsValues()" Mode="Raw" Encode="true" />
</ExtraParams>
</Click>
</DirectEvents>
<Listeners>
<Click Handler="#{gvTransactionList}.editingPlugin.completeEdit();" />
</Listeners>
</ext:Button>


Hello!

It seems that your DirectEvent handler throws an error. Can you provide the DirectEvent handler to investigate?

Hello Baidaly,

Please check the following code behind for SaveClick function.

But as I mentioned earlier, actually show error message before fire that "SaveClick" function in code behind.



protected void SaveClick(object sender, DirectEventArgs e)
{
try
{
List<Transaction> _TransactionList = new StoreDataHandler(e.ExtraParams["Values"]).ObjectData<Transaction>();

string currentLogin = Helper.GetCurrentLoginUser();
string strErrorMessage = string.Empty;

if (Validate_CategoryDefinitionGrpMapping(_Transactio nList))
{
ChangeRecords<Transaction> _CategoryMaster = new StoreDataHandler(e.ExtraParams["data"]).BatchObjectData<Transaction>();
List<Transaction> updateList = new List<Transaction>();
List<Transaction> deleteList = new List<Transaction>();

BLL_Transaction bll_Transaction = new BLL_Transaction();

foreach (Transaction created in _CategoryMaster.Created)
{
created.RECORD_STATUS = CommissionEnum.RecordStatus.INSERT;
created.CurrentUserLogin = currentLogin;
updateList.Add(created);
}

foreach (Transaction deleted in _CategoryMaster.Deleted)
{
deleted.RECORD_STATUS = CommissionEnum.RecordStatus.DELETE;
deleted.CurrentUserLogin = currentLogin;
deleteList.Add(deleted);
}

foreach (Transaction updated in _CategoryMaster.Updated)
{
updated.RECORD_STATUS = CommissionEnum.RecordStatus.UPDATE;
updated.CurrentUserLogin = currentLogin;
updateList.Add(updated);
}

//strErrorMessage = bll_Transaction.UpdateChanges(updateList, deleteList);
if (updateList != null)
{
if (updateList.Count > 0)
{

// Delete all the records for selected term
if (hImportedFile.Value == "1")
{
string term = string.Empty;
DbTransaction dbTransaction = null;
DbConnection dbConnection = null;

term = string.Concat(ddl_Month.SelectedItem.Value, ddl_Year.SelectedItem.Value);
if (!string.IsNullOrEmpty(term))
{
strErrorMessage = bll_Transaction.DeleteTransactionByTerm(term, ref dbTransaction, ref dbConnection);
}
}
strErrorMessage += bll_Transaction.InsertOrUpdate(updateList);
}
}

if (string.IsNullOrEmpty(strErrorMessage))
{
X.Msg.Show(new MessageBoxConfig
{
Title = ProjectName,
Message = "Save Successfully.",
Buttons = MessageBox.Button.OK,
Icon = MessageBox.Icon.INFO
});
hImportedFile.Value = "0";
Bind_gvTransactionList();
}
}

}
catch (Exception ex)
{
X.Msg.Show(new MessageBoxConfig
{
Title = ProjectName,
Message = ex.Message,
Buttons = MessageBox.Button.OK,
Icon = MessageBox.Icon.ERROR
});
}
}

Daniil
Aug 19, 2013, 11:06 AM
Hi,

I guess it denies access to the database.

Baidaly
Aug 20, 2013, 3:24 AM
I would recommend to Profile your requests during DirectEvent using MS SQL Profiler.

canusr1
Aug 21, 2013, 1:16 AM
Hello!

I thought the error popup when there is time out while saving the data.

I already tried out the solution by increasing the timeout in Direct Events.

http://forums.ext.net/showthread.php?25939-Communication-Failure-Error-!!

But it can't help.

Can you provide me a sample that is using MS SQL Profiler in DirectEvent?

Thank you.

Daniil
Aug 21, 2013, 10:24 AM
Please confirm you read these posts:



I guess it denies access to the database.

I would recommend to Profile your requests during DirectEvent using MS SQL Profiler.

canusr1
Aug 22, 2013, 5:00 AM
Hello Daniil,

Yes. I already read these two post.

Can you provide me a sample using MS SQL Profiler in DirectEvent?

Thank you.

Daniil
Aug 22, 2013, 12:20 PM
Can you provide me a sample using MS SQL Profiler in DirectEvent?


Well, it is no an Ext.NET thing at all and has no any relationship with DirectEvents. As far as I can understand you should connect your database and SQL profiler together. Maybe, this link can help.
http://technet.microsoft.com/en-us/library/ms181091.aspx

We assume that you are getting "Access denied" when deal with the database.