Error On deleting from table
Hello Experts.
I am getting error when deleting from table.
please help me.I had given my error.
If possible also tell me how to trace this error.
java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
at java.util.ArrayList.RangeCheck(ArrayList.java:507)
at java.util.ArrayList.get(ArrayList.java:324)
at com.sap.tc.webdynpro.progmodel.context.Node$ElementList.getElement(Node.java:2034)
at com.sap.tc.webdynpro.progmodel.context.Node.isMultiSelected(Node.java:841)
at com.sap.tc.webdynpro.progmodel.context.Node.isMultiSelected(Node.java:839)
at try1.comp1.TableView.onActionDelete_Entry(TableView.java:191)
at try1.comp1.wdp.InternalTableView.wdInvokeEventHandler(InternalTableView.java:191)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:299)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:759)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:712)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:261)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
This Is the code of delete function.
//@@begin onActionDelete_Entry(ServerEvent)
int Count=wdContext.nodePerson().size();
int LeadSelcection=wdContext.nodePerson().getLeadSelection();
for(int i=0;i<Count;i++)
if( (i==LeadSelcection) || wdContext.nodePerson().isMultiSelected(i))
wdContext.nodePerson().removeElement(wdContext.nodePerson().getElementAt(i));
}//if
}//for
//@@end
Similar Messages
-
Hello, everyone.
I am having issues with running a DELETE statement on an Oracle 10g database.
DELETE
FROM tableA
WHERE ID in (1,2,3)
If there is only one ID for the IN clause, it works. But if more than one ID is supplied, I get an "SQL command not properly ended" error message. Here is the query as CF:
DELETE
FROM TRAINING
WHERE userID = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#trim(form.userID)#">
AND TRAINING_ID in <cfqueryparam value="#form.trainingIDs#" cfsqltype="CF_SQL_INTEGER" list="yes">
Anyone work with Oracle that can help me with this? I'm an experienced MS-SQL developer; Oracle is new to me.
Thanks,
^_^Nevermind.. a co-worker just told me that I still have to use parenthesis around the values for the IN clause.
-
Error while deleting from BIA index
HI EXPERTS GETTING BELOW ERROR PLZ GIVE CLARITY ON THIS:
1.A communication error occured, with the TREX TcpIp
2.Error while deleting from BIA index; reconstruction required
THANKS ®ARDS,
rAMESH,Dear Ramesh,
Please check the connection with BIA. Please ask the Basis team to check the BW to BIA connection if they maintain it.
YOu can go to rsddbiamon2 and check BIA connection availibility for more details.
If that is right please try redoing the step at which you faced error and it should help.
Please close the question if you have got the answer or solved it.
Regards,
Den -
How to find out when data was deleted from table in oracle and Who deleted that
HI Experts,
Help me for below query:
how to find out when data was deleted from table in oracle and Who deleted that ?
I did that to fidn out some data from dba_tab_modifications, but I m not sure that what timestamp shows, wether it shows for update,insert or delete time ?
SQL> select TABLE_OWNER,TABLE_NAME,INSERTS,UPDATES,DELETES,TIMESTAMP,DROP_SEGMENTS,TRUNCATED from dba_tab_modifications where TABLE_NAME='F9001';
TABLE_OWNER TABLE_NAME INSERTS UPDATES DELETES TIMESTAMP DROP_SEGMENTS TRU
PRODCTL F9001 1683 46 2171 11-12-13 18:23:39 0 NO
Audit is enable in my enviroment?
customer is facing the issue and data missing in the table and I told him that yes there is a delete at 11-12-13 18:23:39 in table after seeing the DELETS column and timestamp in dba_tab_modifications, but not sure I am right or not
SQL> show parameter audit
NAME TYPE VALUE
audit_file_dest string /oracle/admin/pbowe/adump
audit_sys_operations boolean TRUE
audit_syslog_level string
audit_trail string DB, EXTENDED
please help
Thanks
SamLOGMiner --> Using LogMiner to Analyze Redo Log Files
AUDIT --> Configuring and Administering Auditing -
While deleting project from CJ20N entries are not deleted from table PRPS
Hi,
I am deleting project from CJ20N then from PROJ table entries are getting deleted but WBS element entries are not deleted from table PRPS.
Any deletion Flag should also be checked?
Thanks in advance!
Regards,
JyotiHello,
Thanks for reply !
My problem is I am deleting project and WBS Elements from CJ20N but WBS element entries are not deleted from PRPS table.
Why they are appearing in PRPS table and how it can be deleted?
Thanks ! -
Error When Deleting From A Trigger
When I use a trigger to delete from my Oracle Spatial table, the triggering delete statement will fail if the Oracle Spatial table has a spatial index.
Details:
Tables CHEV_WELLBORE and CHEV_WELLBORE_SDO need to stay in sync. CHEV_WELLBORE_SDO has an sdo geometry column plus foreign keys to join back to CHEV_WELLBORE. When you delete from CHEV_WELLBORE, my trigger is supposed to delete the related row from CHEV_WELLBORE_SDO. When I execute the DELETE FROM CHEV_WELLBORE (one row), it processes for a minute or two then fails with an End Of Communications error. If I try the same thing without the spatial index on CHEV_WELLBORE_SDO it works fine. Can anyone see what I'm doing wrong here?
Connected to:
Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
SQL> drop INDEX CHEV_WELLBORE_SPX force;
Index dropped.
SQL> CREATE OR REPLACE TRIGGER SYNC_WELLBORE_SDO_D
2 AFTER DELETE
3 ON CHEV_WELLBORE
4 FOR EACH ROW
5 WHEN ((old.NO2_BH_LONGITUDE IS NOT NULL AND old.NO2_BH_LATITUDE IS NOT NULL) OR (old.NOD_SURFACE_LONGITUDE IS NOT NULL AND old.NOD_SURFACE_LATITUDE IS NOT NULL))
6 BEGIN
7
8 -- Keep the CHEV_WELLBORE_SDO table in sync with CHEV_WELLBORE
9
10 DELETE FROM CHEV_WELLBORE_SDO WHERE CHEVNO = :old.CHEVNO AND SIDETRACK = :old.SIDETRACK;
11
12 EXCEPTION
13 WHEN OTHERS THEN
14 null; -- Do Nothing, and allow triggering statement to continue without error.
15
16 END;
17 /
Trigger created.
SQL>
SQL> DELETE FROM CHEV_WELLBORE WHERE CHEVNO = '123456';
5 rows deleted.
SQL> ROLLBACK
2 ;
Rollback complete.
SQL> CREATE INDEX CHEV_WELLBORE_SPX
2 ON CHEV_WELLBORE_SDO(GEOMETRY)
3 INDEXTYPE IS MDSYS.SPATIAL_INDEX
4 PARAMETERS (' SDO_LEVEL=14 SDO_NUMTILES=0 SDO_MAXLEVEL=32')
5 ;
Index created.
SQL> DELETE FROM CHEV_WELLBORE WHERE CHEVNO = '123456';
DELETE FROM CHEV_WELLBORE WHERE CHEVNO = '123456'
ERROR at line 1:
ORA-03113: end-of-file on communication channelDoes your DELETE key have an associated After-Process-Branch? Does you page have an "unconditional" Branch. Your unconditional one should have the highest sequence number (of all your branches).
If you have one assinged to the DELETE key, can you check to see what Page or URL is referenced withint that After-Process-Branch. -
Hello,
I set the retention period to 7 days (1 week)
I also set the default ARCHIVE and DELETE jobs and ALL are working fine.
However, messages with OLD dates are NOT deleted from the tables XI_AF_MSG and XI_AF_MSG_AUDIT.
These tables 32GB in the DBD table space.
I tried to use the URL:
http://<host>:<port>/MessagingSystem/archiving/reorgdb.jsp
BUT to NO avail.
How do I DELETE or ARCHIVE these messages ?
============================================
Here are some more details on the content of the tables (I took into account 1 MONTH retention):
db2 "select count(*) from sapxi3db.XI_AF_MSG_AUDIT where STATUS='SUCC' and TIME_STAMP < '2007-09-10 00:00:00'"
28947
1 record(s) selected.
db2 "select count(*) from sapxi3db.XI_AF_MSG_AUDIT where STATUS='ERR' and TIME_STAMP < '2007-09-10 00:00:00'"
13243
1 record(s) selected.
db2 "select count(*) from sapxipdb.XI_AF_MSG where PERSIST_UNTIL < '2007-09-10 00:00:00' and STATUS='NDLV'"
1048
1 record(s) selected.
db2 "select count(*) from sapxipdb.XI_AF_MSG where PERSIST_UNTIL < '2007-09-10 00:00:00' and STATUS='DLVD'"
0
1 record(s) selected.Hi,
First, thank you VERY much for answering.
Now to your questions:
1. When using the URL:
http://<host>:<port>/MessagingSystem/archiving/reorgdb.jsp
I did NOT get any ERROR messages.
Thousands of messages where DELETED successfully.
However, the number of rows in XI_AF_MSG_AUDIT did NOT reduce.
2. I used the default archiving and deletion customizations and jobs.
However, I ran them manually a few times a day with NO change in the
number of rows in XI_AF_MSG_AUDIT
What do you mean by "customized any Archiving for adapter Engine" ?
. In RWB, I do see the default job is running
Have you customized any Archiving for adapter Engine or You are using default arciving which runs every 24 hrs.
3. I did ser the retention period for the adapter engine messages in visual admin in seconds...
Please, advise further.
Kind regards,
Gil -
Problem deleting from table with xmltype column
Hi,
Using a standard, simple screen (generated from JHeadstart), I don't seem to be able to delete from a table including an xmltype column. I have tried it even with a very simple mock table with only one column, an xmltype column, and every time I check the "delete" box and click "save", I get the following error:
oracle.jbo.RowInconsistentException: JBO-25014: Another user has changed the row with primary key oracle.jbo.Key[33 ].
I have tried this in the JDeveloper application module tester too and the result is the same.
Is it possible to delete a row from a table with an xmltype column? Am I doing something wrong? Is there something special needs done?
As I say, I did this with a one-xmltype-column table using the "Business Components from Tables" wizard, accepting all the defaults.
Thanks,
DarrenIn short you want
SELECT extractvalue(myxml, '/PurchaseOrder/Reference')
FROM dab_test;This difference is that for dab_xml, there are no columns defined for the table, therefore you are [OBJECT_VALUE|http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/pseudocolumns006.htm#sthref830] as an alias for a non existent column.
With dab_test, you have a column that contains the XML so you need to use that column name instead of OBJECT_VALUE. -
Delete From Table on Cancel Button.
Hi,
i am facing funny problem.
i have created form with report page and i have implement send email option on Page so i am attach more document with email.if i attach document then it's going in DUMY_DOC_FILE table .
i have create a process
delete from DUMY_DOC_FILE .
Process Point IS ON Submit -After Conmputation and Validation
On Page No 6.if i press Cancel Button.This button is redirect on page No 4.My Code on Page no 6.
page is redirect to 4 but doc don't delete from DUMY_DOC_FILE Table.
How to delete Doc From Table If I press Cancel Button.
Thanks
Edited by: 805629 on Jan 13, 2011 5:25 AM
Edited by: 805629 on Jan 13, 2011 11:49 PM
Edited by: 805629 on Jan 14, 2011 12:43 AM<li>Change Cancel Button in page 6 so that it submits.
<li>If u have conditions on that delete PLSQL process, make sure that it runs when CANCEL button is pressed also. If it is unconditional, let it be.
<li>Add a branch for the Cancel button which redirect to page 4
So effectivelly instead of *[CANCEL] -> [Redirect to page 4]* , it becomes *[CANCEL] -> [SUBMIT] -> [DELETE PROCESS] -> [Branch: redirect to page 4]* -
Error when deletting internal table
Hi to all,
I have small requirement. Am getting runtime error , when am deleting internal table when that internal table will have only one record. how i can solve this problem. Give me some clues.Hi Geetha, you can do this
IF itab[] IS NOT INITIAL.
LOOP AT it_ekbe.
IF it_ekbe-bwart_i NE '101' AND it_ekbe-bwart_i NE '105' AND it_ekbe-bwart_i NE '201' OR it_ekbe-bwart_i NE '202' AND
it_ekbe-bwart_i NE '221' AND it_ekbe-bwart_i NE '222' AND it_ekbe-bwart_i NE '231' AND it_ekbe-bwart_i NE '232' AND
it_ekbe-bwart_i NE '241' AND it_ekbe-bwart_i NE '242' AND it_ekbe-bwart_i NE '251' AND it_ekbe-bwart_i NE '252' AND
it_ekbe-bwart_i NE '261' AND it_ekbe-bwart_i NE '262' AND it_ekbe-bwart_i NE '281' AND it_ekbe-bwart_i NE '282' AND
it_ekbe-bwart_i NE '291' AND it_ekbe-bwart_i NE '292'.
DELETE itab WHERE mblnr = it_ekbe-lfbnr_i
AND matnr_i = it_ekbe-matnr_i
AND ebeln_i = it_ekbe-ebeln_i
AND ebelp_i = it_ekbe-ebelp_i
AND werks_i = it_ekbe-werks_i.
ENDIF.
ENDLOOP.
ENDIF.
This routine does the same but with better performance, I hope this help you.
Regards
David Carballido -
Hello
I have a dataset that was created at design time
but - after I run the app, it randomly creates a table based on The Users name
since I do not know the users name before had, the table is not part of my existing dataset
(I actually used an insert into sql nonquery to just make this table a copy of the masterUserTable)
Now - I have a binding navigator on my form, that is originally bound to masterUserTable, but my goal is to make it bound to the users table (let's say GabrielUserTable)
I thought I did so with this code:
'TODO: This line of code loads data into the 'MyLearningDBDataSet.masterUserTable' table. You can move, or remove it, as needed.
Me.MyMainDBTableAdapter.Fill(Me.MyLearningDBDataSet.masterUserTable)
Dim ThisNewVariable As String = MyUserNameIs & "UserTable"
Dim ThisNewTableName As New DataTable
Me.MyLearningDBDataSet.masterUserTable.TableName = ThisNewVariable
Me.MyMainDBTableAdapter.Fill(Me.MyLearningDBDataSet.masterUserTable)
that appeared to do the trick (but if it is incorrect please advice on the proper way to add a table made at runtime to a users existing datset)
Else where in my code I successfully execute the following NonQuery :
SqlString= "DELETE FROM " & MyUserNameIs & "UserTable" & vbCrLf &
"WHERE vState='" & txtStateInfo.Text & "';"
I check in Visual Studio 2013 that the row was deleted from the "GabrielUserTable" (Gabriel is the current value of MyUserNameIs) by using the Server Explorer and right clicking
on the table and choosing show talbe data
But the MyMainDBBindingNavigator is still showing the item I deleted.
So after searching for answers - I created a new button for testing and added the following code to test if it would work
Me.Validate()
Me.MyMainDBBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.MyLearningDBDataSet)
but the data is still shwoing after deleting it with my NonQuery
Please Help!Hi genterprise,
>> Now - I have a binding navigator on my form, that is originally bound to masterUserTable, but my goal is to make it bound to the users table (let's say GabrielUserTable)
In my option, if you want to rebind the users table to the navigator, you need to set the BindingNavigator.BindingSource. Based on your description, it seems that you did not reset the datasoure of the MyMainDBBindingNavigator. It was the original datasource
of the masterUserTable. For more details about BindingNavigator.BindingSource Property. You could refer the link below:
# BindingNavigator.BindingSource Property
https://msdn.microsoft.com/en-us/library/system.windows.forms.bindingnavigator.bindingsource%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396
Best Regards,
Edward
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey. -
NullPointerException when deleting from table with no non-primary keys
We have an object mapped to a table in our database.
This table has two fields that together form a composite key. When we attempt to perform a delete from this table using the mapped object we receive the following exception and stack trace:
java.lang.NullPointerException
at oracle.toplink.descriptors.FieldsLockingPolicy.getAllNonPrimaryKeyFields(Unknown Source)
at oracle.toplink.descriptors.AllFieldsLockingPolicy.getFieldsToCompare(Unknown Source)
at oracle.toplink.descriptors.FieldsLockingPolicy.buildExpression(Unknown Source)
at oracle.toplink.descriptors.FieldsLockingPolicy.buildDeleteExpression(Unknown Source)
at oracle.toplink.internal.descriptors.ObjectBuilder.buildDeleteExpression(Unknown Source)
at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.buildDeleteStatement(Unknown Source)
at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.prepareDeleteObject(Unknown Source)
at oracle.toplink.internal.queryframework.StatementQueryMechanism.deleteObject(Unknown Source)
at oracle.toplink.queryframework.DeleteObjectQuery.execute(Unknown Source)
at oracle.toplink.queryframework.DatabaseQuery.execute(Unknown Source)
at oracle.toplink.publicinterface.Session.internalExecuteQuery(Unknown Source)
at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(Unknown Source)
at oracle.toplink.tools.profiler.PerformanceProfiler.profileExecutionOfQuery(Unknown Source)
at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
at oracle.toplink.internal.sessions.CommitManager.deleteAllObjects(Unknown Source)
at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(Unknown Source)
at oracle.toplink.publicinterface.UnitOfWork.commitRootUnitOfWork(Unknown Source)
at oracle.toplink.publicinterface.UnitOfWork.commit(Unknown Source)
<snip remainder of stack trace>
The table definition for our table is as follows:
PK,FK TASK_ID NUMBER NOT NULL
PK,FK USER_ID NUMBER NOT NULL
Each field is a foreign key to another table, however this is not a join table for a many to many relationship.
The mapping definition for the mapped object is as follows:
public Descriptor buildProConSubscriptionDescriptor( )
Descriptor descriptor = new Descriptor( );
descriptor.setJavaClass( mil.usmc.mol.procon.domain.ProConSubscription.class );
descriptor.addTableName( "PRO_CON_SUBSCRIPTION" );
descriptor.addPrimaryKeyFieldName( "PRO_CON_SUBSCRIPTION.TASK_ID" );
descriptor.addPrimaryKeyFieldName( "PRO_CON_SUBSCRIPTION.USER_ID" );
// Descriptor properties.
descriptor.useNoIdentityMap( );
descriptor.setIdentityMapSize( 1000 );
descriptor.useRemoteNoIdentityMap( );
descriptor.setRemoteIdentityMapSize( 1000 );
descriptor.setAlias( "ProConSubscription" );
descriptor.useAllFieldsLocking( );
// Query manager.
descriptor.getQueryManager( ).checkDatabaseForDoesExist( );
//Named Queries
// Event manager.
// Mappings.
DirectToFieldMapping taskIdMapping = new DirectToFieldMapping( );
taskIdMapping.setAttributeName( "taskId" );
taskIdMapping.setGetMethodName( "getTaskId" );
taskIdMapping.setSetMethodName( "setTaskId" );
taskIdMapping.setFieldName( "PRO_CON_SUBSCRIPTION.TASK_ID" );
descriptor.addMapping( taskIdMapping );
DirectToFieldMapping userIdMapping = new DirectToFieldMapping( );
userIdMapping.setAttributeName( "userId" );
userIdMapping.setGetMethodName( "getUserId" );
userIdMapping.setSetMethodName( "setUserId" );
userIdMapping.setFieldName( "PRO_CON_SUBSCRIPTION.USER_ID" );
descriptor.addMapping( userIdMapping );
return descriptor;
Any thoughts as to why this is happening?
Thanks,
Andrew LeeHi Andrew,
AllFieldsLocking isn't designed for this since you have an object that's composed entirely of primary data. You should make use of any other of TopLink's locking policies to make this work. For instance, try useChangedFieldsLocking(), pessimistic or any of the optimistic locking strategies available from within TopLink for this to work based on the design you have outlined.
Darren -
Query Error - Characteristic deleted from Info Provider
My query is giving me an error saying Characteristic ZCS_IS53___F278 is used in the Query Designer, but was deleted from the InfoProvider.
This is not so....I've adjusted and reactivated the infoset, but continue to get this error.
Any suggestions?
Thanks,
AngieHi,
Check if the characteristic has been removed from infoset due to the changes in the base infoprovider of the infoset. Also check if it enabled i.e checked.
Try opening the infoset, if there is any inconsistency in the infoset it will request for adjust. This you can do it in Tcode RSISET. In mean option you will be able to get the Adjust. Then try running the query.
Regards
Akhan -
DataGrid not reflecting changes after INSERT into Table. Delete from Table does.
Wow, it's been a while.
Hope you guys can help.
This is my DataGrid:
<DataGrid DataContext="{StaticResource TableAssetsViewSource}" ItemsSource="{Binding}" x:Name="TableAssetsDataGrid" AutoGenerateColumns="False" EnableRowVirtualization="True" Margin="15,10,10,10" RowDetailsVisibilityMode="VisibleWhenSelected" Grid.Column="1" HeadersVisibility="Column" CanUserResizeRows="False" IsReadOnly="True">
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="BorderThickness" Value="0"/>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<DataGridTextColumn x:Name="NodeColumn" Binding="{Binding node}" Header="VS Number" Width="*"/>
<DataGridTextColumn x:Name="SerialColumn" Binding="{Binding serial}" Header="Serial Number" Width="*"/>
<DataGridTextColumn x:Name="NameColumn" Binding="{Binding name}" Header="Asset Name" Width="*"/>
<DataGridTextColumn x:Name="TypeColumn" Binding="{Binding type}" Header="Asset Type" Width="*"/>
<DataGridTextColumn x:Name="_dateColumn" Binding="{Binding date}" Header="Date Allocated" Width="*"/>
<DataGridTextColumn x:Name="PoColumn" Binding="{Binding po}" Header="Purchase Order" Width="*"/>
</DataGrid.Columns>
</DataGrid>
This is where I add a new Row to the Table:
Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
Dim cbblocation As ComboBox = Me.FindName("LocationComboBox")
Dim row As DataRowView = DirectCast(cbblocation.SelectedItem, DataRowView)
Dim cbbtext As String = row.Item("node")
Dim cbbtype As ComboBox = Me.FindName("comboBoxType")
Dim cbbtext2 As String = cbbtype.Text
Dim RETAILISOAMDDataSet As Retail_ISO_AMD.RETAILISOAMDDataSet = CType(Me.FindResource("RETAILISOAMDDataSet"), Retail_ISO_AMD.RETAILISOAMDDataSet)
Dim RETAILISOAMDDataSetTableAssetsTableAdapter As Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter = New Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter()
RETAILISOAMDDataSetTableAssetsTableAdapter.AddNewAsset(cbbtext, txbSerial.Text, txbName.Text, cbbtext2, Date.Today, txbPO.Text)
node = cbbtext
Dim mp As New MainPage
mp.RefreshGrid(node)
Me.Close()
End Sub
The RefreshGrid method:
Public Sub RefreshGrid(node As String)
Dim RETAILISOAMDDataSet As Retail_ISO_AMD.RETAILISOAMDDataSet = CType(Me.FindResource("RETAILISOAMDDataSet"), Retail_ISO_AMD.RETAILISOAMDDataSet)
Dim RETAILISOAMDDataSetTableAssetsTableAdapter As Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter = New Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter()
RETAILISOAMDDataSetTableAssetsTableAdapter.FillByNode(RETAILISOAMDDataSet.tableAssets, node)
Dim TableAssetsViewSource As System.Windows.Data.CollectionViewSource = CType(Me.FindResource("TableAssetsViewSource"), System.Windows.Data.CollectionViewSource)
Dim be As BindingExpression = BindingOperations.GetBindingExpression(TableAssetsViewSource, CollectionViewSource.SourceProperty)
be.UpdateTarget()
End Sub
And this is what I use to delete a row from the table (and without doing anything special, the DataGrid auto-updates with the changes):
Private Sub Button_Click_4(sender As Object, e As RoutedEventArgs)
If TableAssetsDataGrid.SelectedIndex = -1 Then
MsgBox("You have selected nothing to Delete!", MsgBoxStyle.OkOnly, "Nothing Selected")
Else
Dim dgv As DataGridTextColumn = Me.FindName("NodeColumn")
Dim row As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
Dim dgvText As String = row.Item("node")
Dim dgv2 As DataGridTextColumn = Me.FindName("SerialColumn")
Dim row2 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
Dim dgvText2 As String = row.Item("serial")
Dim dgv3 As DataGridTextColumn = Me.FindName("NameColumn")
Dim row3 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
Dim dgvText3 As String = row.Item("name")
Dim dgv4 As DataGridTextColumn = Me.FindName("TypeColumn")
Dim row4 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
Dim dgvText4 As String = row.Item("type")
Dim dgv5 As DataGridTextColumn = Me.FindName("_dateColumn")
Dim row5 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
Dim dgvText5 As String = row.Item("date")
Dim dgv6 As DataGridTextColumn = Me.FindName("POColumn")
Dim row6 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
Dim dgvText6 As String = row.Item("po")
Dim RETAILISOAMDDataSet As Retail_ISO_AMD.RETAILISOAMDDataSet = CType(Me.FindResource("RETAILISOAMDDataSet"), Retail_ISO_AMD.RETAILISOAMDDataSet)
Dim RETAILISOAMDDataSetTableAssetsTableAdapter As Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter = New Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter()
RETAILISOAMDDataSetTableAssetsTableAdapter.RemoveAsset(dgvText, dgvText2, dgvText3, dgvText4, dgvText5, dgvText6)
Dim cbb As ComboBox = Me.FindName("cbbLocation")
Dim row7 As DataRowView = DirectCast(cbb.SelectedItem, DataRowView)
Dim cbbtext As String = row.Item("node")
RefreshGrid(cbbtext)
End If
End Sub
--------- End of Edit
It is bound to a Dataset which gets it's data from a SQL Database.
Loading the Data and Filtering the data based on certain conditions work 100%. The problem I am having is as follows:
I have a form on the Page that takes input and inserts a row into the Database. When this happens, the DataGrid won't automatically reflect the changes (even if I recall the Fill Method of the Dataset). No matter what I do, I have to refresh the entire page
and THEN Fill the Dataset to see any changes.
This is what strikes me as odd...
When I do a delete row operation on the Database (Custom Method on the Dataset with conditions), and just Fill the Dataset again (without doing anything special), the row deletes and the changes is reflected IMMEDIATELY.
What am I doing wrong here? Why would Delete Row reflect the changes on the DataGrid but no Insert Row?
Thanks in Advance.
(P.S. I am very rusty with my developing skills, I haven't done this in YEARS)>>And what about the the most important question, how exactly is TableAssetsViewSource defined in the XAML markup and what is
its Source property set or bound to? And what about the reproducable sample...?
Here is the Markup of the TableAssetsViewSource:
<Page.Resources>
<local:RETAILISOAMDDataSet x:Key="RETAILISOAMDDataSet"/>
<CollectionViewSource x:Key="TableRegionsViewSource" Source="{Binding tableRegions, Source={StaticResource RETAILISOAMDDataSet}}"/>
<CollectionViewSource x:Key="TableLocationsViewSource" Source="{Binding tableLocations, Source={StaticResource RETAILISOAMDDataSet}}"/>
<CollectionViewSource x:Key="TableAssetsViewSource" Source="{Binding tableAssets, Source={StaticResource RETAILISOAMDDataSet}}"/>
</Page.Resources>
The ItemsSource of the DataGrid is bound to the TableAssetsViewSource:
<DataGrid DataContext="{StaticResource TableAssetsViewSource}" ItemsSource="{Binding}" x:Name="TableAssetsDataGrid" AutoGenerateColumns="False" EnableRowVirtualization="True" Margin="15,10,10,10" RowDetailsVisibilityMode="VisibleWhenSelected" Grid.Column="1" HeadersVisibility="Column" CanUserResizeRows="False" IsReadOnly="True">
Just remember, this code was auto-generated with the drag & drop onto the Page, so I did little in terms of setting the actual bindings.
All in all, what I have done so far works as intended, except that when I want to add a row to the table it does not reflect, and that it only shows after refreshing/restarting the application.
I will try and put together a reproducable sample. -
Getting an error while selecting from table having CLOB column.
Hi All,
I have below table created in My oracle database version Oracle Database 11g Enterprise Edition Release 11.2.0.1.0.
CREATE TABLE my_clob -- Dummy table created
(DataBody CLOB);
Current Database Character set - WE8MSWIN1250.
On the front end of my application, I have one form through which I can save/edit data in the above table. If I'm creating one new entry in the above table then it first check with existing record to avoid the duplicate entry and the this point application create the below select statement on the above table and return the error "ORA-00932: inconsistent data types: expected - got CLOB".
I can not change the sql statement.
SELECT * FROM my_clob WHERE databody IS NULL OR databody ='';
Even when I run the same statement on my DB server I’m getting the same error. Shown below
SQL> SELECT * FROM my_clob WHERE databody IS NULL OR databody ='';
SELECT * FROM my_clob WHERE databody IS NULL OR databody =''
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected - got CLOB
SQL>
Is there anything with OraOLEDB which causing this error? Please help me out to get rid of this error.
Thanks,
SantoshYou cannot compare directly a CLOB column with a VARCHAR2 column. In your case you don't need to do such comparison because Oracle consider zero length strings as null values:
SQL> create table my_clob(data int, databody clob);
Table created.
SQL> insert into my_clob values(1, null);
1 row created.
SQL> insert into my_clob values(2, '');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from my_clob where databody is null;
DATA
DATABODY
1
2About null values in Oracle, please read http://docs.oracle.com/cd/E11882_01/server.112/e26088/sql_elements005.htm#SQLRF30037.
Maybe you are looking for
-
Since last few Nightly updates, I am getting one or more (one site had 5 domains) popup requests similar to "Allow ad.doubleclick.net to access your contacts? [] Don't ask for this site again. Allow access Don't allow access .... This is getting real
-
How do I cancel a magazine subscription renewal
I got a message saying my magazine subscription automatically renewed and I have 24 hours to cancel it, but I'm not sure how?
-
Can't log into main account and vanished files...?
Hello forums. Last night I was trying to get rid of some junk on my computer, emptying a lot of files in my Trash. Cleaned up my desktop... everything going smoothly. Turned off the computer. I realized there was something fishy this morning when I t
-
how can i make my motion titles for my final cut pro project not jiggle? if i create titles in final cut pro, they also jiggle. thanks, dominic
-
Multi-Factor Authentication with Azure, need to know limitations
Hello, This forum was recommended as a place to ask MFA questions. The manager desires all the domain admins accounts to use MFA, when used for any purpose, but especially for when these accounts are used for managing the domain, either via workstati