1
Answer

Shortcut to a shortcut key (DataGrid + Buttons)

Photo of saperus

saperus

21y
2.8k
1
this is a strange behavior of buttons with shortcut keys, when You have a datagrid on a form and some buttons with shortcut keys. When You click on the datagrid (anywhere but the cells, free space, header or something) and press the shortcut key (without the ALT key pressed) button's action is called. You can easyly recreate this by creating a simple project with datagrid and a button with shortcut key (&Delete in the Text property for example). Then add event handler for rhis button's click event, for example show a message box. Run the app. click anywhere on the datagrid. press the D button (without ALT). The button's action is called. how can I prevent this from happening? Saper(ek)

Answers (1)

1
Photo of Rahul Prajapat
NA 2.1k 191.7k 9y
Hello @Vilas try this query:
 
SELECT * FROM (SELECT * FROM dbo.Table_1 t UNION SELECT * FROM dbo.Table_2 t)AS Student WHERE Student.roll='E-153'
 
I hope this will help you.
Accepted
1
Photo of Karthikeyan K
NA 6.4k 488.1k 9y
SQL> CREATE TABLE SAMPLE(ID NUMBER,NAME VARCHAR(20));

Table created.

SQL> CREATE TABLE SAMPLE1(ID NUMBER,NAME VARCHAR(20));

Table created.

SQL> INSERT INTO SAMPLE(ID,NAME) VALUES('&ID','&NAME');
Enter value for id: 1
Enter value for name: KARTHIK
old 1: INSERT INTO SAMPLE(ID,NAME) VALUES('&ID','&NAME')
new 1: INSERT INTO SAMPLE(ID,NAME) VALUES('1','KARTHIK')

1 row created.

SQL> /
Enter value for id: 2
Enter value for name: MITHU
old 1: INSERT INTO SAMPLE(ID,NAME) VALUES('&ID','&NAME')
new 1: INSERT INTO SAMPLE(ID,NAME) VALUES('2','MITHU')

1 row created.
SELECT ID,NAME FROM(SELECT * FROM SAMPLE UNION ALL SELECT * FROM SAMPLE1) WHERE ID=2;
SQL> INSERT INTO SAMPLE1(ID,NAME) VALUES('&ID','&NAME');
Enter value for id: 3
Enter value for name: VINITH
old 1: INSERT INTO SAMPLE1(ID,NAME) VALUES('&ID','&NAME')
new 1: INSERT INTO SAMPLE1(ID,NAME) VALUES('3','VINITH')

1 row created.

SQL> /
Enter value for id: 4
Enter value for name: MENON
old 1: INSERT INTO SAMPLE1(ID,NAME) VALUES('&ID','&NAME')
new 1: INSERT INTO SAMPLE1(ID,NAME) VALUES('4','MENON')

1 row created.

SQL> SELECT ID,NAME FROM(SELECT * FROM SAMPLE UNION ALL SELECT * FROM SAMPLE1) WHERE ID=2;

ID NAME
---------- --------------------
2 MITHU
0
Photo of Vilas Dongre
NA 383 18.7k 9y
Actually Person is the single table through which we can find but I want single query to search single record from multiple tables
0
Photo of Rajeesh Menoth
NA 24.7k 629.6k 9y
Hi,
 
A UNION will return unique results, whereas a UNION ALL will return everything including duplicates.