C Prevent SQL injection, when typing, there will be more than three errors, indicating that it can n

Updated on technology 2024-05-20
20 answers
  1. Anonymous users2024-02-11

    First of all, your question: declare an integer variable as a counter, judge the counter before each input, if the counter is less than 3, then allow the input, and let the counter increment by 1, if the counter is greater than 3, it will prompt that it can not be entered again.

    int i=0;

    if(i<3)

    Input is allowed. i++;else

    Prompt: Cannot be entered.

    I suspect that your understanding of SQL injection is biased, the so-called SQL injection does not refer to the insertion of a large amount of data into the database, but refers to the data corruption or leakage caused by injecting query statements into the database. To prevent SQL injection, it is actually very simple, do not directly concatenate query statements, but use SQL parameters to pass parameters. There is a lot of knowledge about this on the Internet, as long as you are interested, you will definitely be able to figure it out.

    PS: If you understand SQL injection correctly, then the above way of limiting the number of inputs will not solve the problem at all.

  2. Anonymous users2024-02-10

    To prevent SQL injection, you don't need to use @name, sqlparameter nameparameter=new sqlparameter("name",name); Is it like this? Do you use it again?

  3. Anonymous users2024-02-09

    Is it recorded in the data sheet? Probably the reason for the record.

    The primary key cannot be empty.

    There should be no other problems.

    If it doesn't work. Don't forget the primary key.。。 It shouldn't be a very important system, and it can run without a primary key. Just some of the impact on speed.

  4. Anonymous users2024-02-08

    ODBC Error: [Microsoft][ODBC SQL Server Driver][SQL Server]Create Unique Index terminated because a duplicate key was found that destroys the extremity index ID 1. The most important primary key is the simplified type'12'。

    Microsoft][ODBC SQL Server Driver][SQL Server] is not able to create constraints. See the previous error message.

    The Microsoft][ODBC SQL Server Driver][SQL Server] statement was terminated.

  5. Anonymous users2024-02-07

    View the error log.

    microsoft sql server\

    Find out the cause of the error.

  6. Anonymous users2024-02-06

    Post the error prompt, and everyone can help you analyze it.

  7. Anonymous users2024-02-05

    He's already prompted you to look at the log message.,You have to post the content to know what's going on.,I guess the instance name is occupied.。

  8. Anonymous users2024-02-04

    What is the wrong word? Get the right medicine!

  9. Anonymous users2024-02-03

    Have you installed SQL before? If you install it, it's useless when you uninstall it.,You need to delete the previously installed ones in the registry.,Otherwise, it's not good.。

  10. Anonymous users2024-02-02

    Did your machine install SQL before If so, you should delete the files you installed before, don't leave the files, and then delete the files that you haven't installed successfully, restart the computer, and it should be okay to reinstall it, if it still doesn't work, then there should be a problem with the SQL version you installed,

  11. Anonymous users2024-02-01

    Reinstall the system, don't install the lite version.

  12. Anonymous users2024-01-31

    The ODBC data source needs to be configured.

  13. Anonymous users2024-01-30

    --The landlord deletes the login yh before deleting the login yh, he has to delete his database yh before he can delete the login yh

    drop user user11

    drop login user11

  14. Anonymous users2024-01-29

    There may be users connected to this db instance, as you can see.

  15. Anonymous users2024-01-28

    Data is cascaded and cannot be deleted directly.

  16. Anonymous users2024-01-27

    In the process of installation, you have 15 checks, and you must have passed or not, and as long as one of them fails, it cannot be installed correctly, and all of them must be solved before it can be installed.

  17. Anonymous users2024-01-26

    You can go to the corresponding online and offline to install it successfully, and then install it again when you pass it, and you can install it normally.

  18. Anonymous users2024-01-25

    I studied computer science, and I used to install and install this, and similar problems always appeared.

    On the one hand, it may be a matter of version, and the SQL that we used to use is, and a few of them are installed anyway, but it doesn't affect the use, like the online series.

    On the other hand. That's because SQL is a non-compatible program software, you have installed SQL before, although you uninstall it, but it can't be completely uninstalled, once the system is used, there will be conflicts when installing.

    It is recommended that you uninstall it carefully again, uninstall it cleanly, and install it again.

    If that doesn't work, it's best to reinstall the system, and it's best to install SQL before installing anything else

  19. Anonymous users2024-01-24

    if not exists(select @id=id from student where id=@id)

    And. if exists(select @id=id from student where id=@id)

    The @id==, because you are judging whether there is a value here, not giving the value, when you look at this ** in the query analyzer, there should be a red wavy line below the = of @id=, indicating that there is a problem here.

  20. Anonymous users2024-01-23

    if exists(select @id=id from student where id=@id)

    What do you want? It's the assignment again, and it's the query for whether it exists.

    Changed to Yves Exisz (Selekett Edfrom StudentWheelide = @伊德).

Related questions
10 answers2024-05-20

First of all, you need to know what is the melting temperature of chocolate, and most pure chocolates have a melting point of 34. The core ingredients of chocolate are cocoa butter and cocoa powder. >>>More

25 answers2024-05-20

What English? Can you elaborate? It should be the volume label of your C disk,That doesn't matter,You can delete it from "My Computer" Click on the C disk,The method is to click on the C disk symbol,The cursor flashes to delete the modified content,That drive letter is a symbol,You can also write it as"System disk"For example, you can write it as Windows XP to remind you that the C disk is a system disk when you operate on the disk,There is no other use。 >>>More

6 answers2024-05-20

There will be many dangers that we may encounter when traveling, for example, we may get lost on the way to travel, and we may encounter bad people, and even in some high-risk areas of tourist attractions, and we may also be bitten by some poisonous insects or snakes on the way to travel, which may cause their own injuries, and may be fatal in serious cases, so when we travel, we must not travel alone, it is best to travel with family and friends, so as to facilitate our safety.

5 answers2024-05-20

Congratulations... If you have a printer on your computer, reinstall it, if not, see below. >>>More

12 answers2024-05-20

As the saying goes, good people hope that they can return to their roots, and dogs too, they are not sure whether they can be buried by their owners after they die, so when they are about to die, they run away from home and find a better place for themselves, dig a pit, and bury themselves. <>