|
It probably doesn't reference real encryption. The assignment likely has a faux encryption function.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Member 15284301 wrote: BYE..! /wave.
It's not like the site *needs* your question. You come here, with a basic question.
As for me, it doesn't tickle me. At all. I could not care any way, since that's what I is paid. Nothing.
And bloody easy to do, but I do not owe you an answer, do I?
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
@Eddy Vluggen No body ask you for reply so buzz off dude i got my reply here no one wants to help simple thing i am not a coder so no issues for me will find other forums BYE BYE..!
|
|
|
|
|
Member 15284301 wrote: i am not a coder Obvious, not a problem usually. You challenging one who is.
Member 15284301 wrote: BYE BYE..! Yeah, like I'm missing out on that.
I'll be sitting here crying. For months, I crying for missing your project. The horror of missing it!
Bye, bye May we never meet again.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
@Eddy Vluggen baby dont cry forever!!! Dont brag about ur coding skill there are better coder than u YES surely we dont meet again 4 good 
|
|
|
|
|
I do not need to brag
"ur"? Like I said, I need not brag.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
query is:
INSERT INTO FileInfo VALUES ('2021', 'ALex', 'Dunlop') WHERE NOT EXISTS (SELECT 1 FROM FileInfo WHERE EqpCode='2021')
The table has 3 columns.
SQLite says:
syntax error near WHERE
How can I fix it?
modified 8-Jul-21 13:40pm.
|
|
|
|
|
First off, don't INSERT like that - always list the columns into which you want to ISNERT values - if someone (very sensibly) adds an ID column for example, it can really mess up your code, even if the ID column is of IDENTITY type so you can't INSERT to it!
Listing the columns in the order you supply their values makes your code safer and easier to maintain in future.
Secondly, you can't add a WHERE clause to an INSERT operation because it doesn't affect any existing rows - it only ever adds new ones.
If you want to do an insert if no matching rows exist use IF[^] or CASE[^] instead.
I'd probably use COUNT(...) = 0 instead of EXISTS(...) as well.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Do you mean this:
INSERT INTO FileInfo (EqpCode, EqpName, FileName) VALUES ('123', 'rty', 'iuo') WHERE NOT EXISTS (SELECT 1 FROM FileInfo IF EqpCode='123')
It has the same Error.
|
|
|
|
|
Again, there is no such thing as a WHERE clause on an INSERT statement. Remove everything from WHERE to the end of the statement.
|
|
|
|
|
I had used a similar query in C# and it was working well (SQL server CE):
mycommand.CommandText = $"INSERT INTO MyData([Wo], [EqN], [Code], [Work], [Cost]) SELECT '{DataGridView3.Rows[i].Cells[0].Value}', '{DataGridView3.Rows[i].Cells[1].Value}', '{DataGridView3.Rows[i].Cells[2].Value}', '{DataGridView3.Rows[i].Cells[3].Value}', '{DataGridView3.Rows[i].Cells[4].Value}' WHERE NOT EXISTS (SELECT 1 FROM MyData WHERE [Wo]='{DataGridView3.Rows[i].Cells[0].Value}' AND [Code]='{DataGridView3.Rows[i].Cells[2].Value}')";
|
|
|
|
|
Yes, but the WHERE clause is connected to the SELECT , not the INSERT .
|
|
|
|
|
I found an easy way. I changed EqpCode column type to UNIQUE and Unique Conflict Clause to REPLACE.
Then:
INSERT INTO FileInfo(EqpCode, EqpName, FileName) VALUES ('123', 'test01', 'test02')
ON CONFLICT(EqpCode) DO UPDATE
SET EqpName = EXCLUDED.EqpName,
FileName = EXCLUDED.FileName;
modified 8-Jul-21 15:04pm.
|
|
|
|
|
Some have given you the answer but not really shown you what they mean. You can't use WHERE without a SELECT. So, you do something like this:
INSERT INTO Table1(Field1, Field2, ...)
SELECT '2021', 'Alex', ...
WHERE NOT EXISTS (...)
|
|
|
|
|
DevParty wrote: You can't use WHERE without a SELECT.
Um ... you sure?
UPDATE MyTable SET MyColumn = @MyValue WHERE MyOtherColumn = @MyOtherValue
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: DevParty wrote: You can't use WHERE without a SELECT.
Um ... you sure?
UPDATE MyTable SET MyColumn = @MyValue WHERE MyOtherColumn = @MyOtherValue
I'm pretty sure he meant an INSERT, clause, not an UPDATE one! 
|
|
|
|
|
What he may have meant and what he said are not necessarily the same thing!
Particularly with beginners, you have to be accurate - a bald statement like "WHERE only works with SELECT" is not accurate and can confuse.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: a bald statement like "WHERE only works with SELECT" is not accurate and can confuse.
Would that be a statement without any hair?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Wouldn't know - I still have a ponytail.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
For inserting data. Stay in context. 
|
|
|
|
|
I want to create shared memory in a C# windows application. And a second console application in visual studio has to share the same memory using OpenFileMapping function.
Is it possible to share memory as I mentioned between one application in C# and other application in Visual C++ console application.
Please advise and suggest the ways of doing this
|
|
|
|
|
The BCL has plenty of support for memory-mapped files:
Memory-Mapped Files | Microsoft Docs[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
This gives details for creating and opening shared memory between 2 C# application processes.
Please help me to share memory between 2 applications, one in C# and other VC++ console application to open the share memory created in C# application. Is it possible of doing this? Please advise
|
|
|
|
|
The documentation tells you how to create or access memory-mapped files from a C# application.
You presumably already know how to create or access memory-mapped files from a C++ application. If not, the Microsoft docs site has details:
Memory-Mapped File Information - Win32 apps | Microsoft Docs[^]
The file doesn't care which language was used to create the process that's accessing it.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I would strongly suggest that you don't: instead redesign to use message based communications via Named Pipes[^] or Sockets C#[^] / Sockets C++[^]
It's a much more robust solution that can be a whole load more flexible.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|