C Do transactions have to be in the database?

Updated on technology 2024-02-08
12 answers
  1. Anonymous users2024-02-05

    It is possible to write things directly in c.

  2. Anonymous users2024-02-04

    This kind of business processing is not expected by the design of DataGridView.

    DataGridView is designed as a data source-binding mode, which is to hope that when the database data changes, we can execute the binding method to synchronize the page display.

    The basic idea of adding, deleting, modifying, and querying is as follows: Get a new value -- operate the library -- rebind.

  3. Anonymous users2024-02-03

    After deleting a record, you need to bind the data source to the datagridview again so that consistency can be achieved.

  4. Anonymous users2024-02-02

    Definitely different, the transaction of C ** is a transaction of business logic, while the transaction in SQL is a transaction of data logic, maybe the transaction of business logic teaches the scope of transactions of SQL is larger, and the designer needs to control the transaction.

  5. Anonymous users2024-02-01

    Depending on whether you intend to control the transaction in the logic of the database or in the logic of the business, in fact, the implemented transaction will also be converted to a database transaction.

    There is a lot of controversy on the Internet, and personally, I prefer to agree that transactions should be done by our programs, not through SQL statements, because SQL statements are dead, while business is alive.

    For example, when the business side wants to add users, the users must enter a certain group, in fact, this is a business requirement, and it is better to implement it in **.

    There are also some transactions that are difficult to complete with a database because there is a lot of data that is dynamic and has to be done through **.

  6. Anonymous users2024-01-31

    I think the runtime environment is different, the transactions in C run in the .NET Framework hosting environment, and the transactions in SQL statements run in the data engine of SQL Server.

  7. Anonymous users2024-01-30

    sqltransaction is a transaction object in class C, which can maintain the data uniformity of the database.

    This is required when multiple SQL statements are executed at the same time.

    For example, if the first two statements are successfully executed, but the third one is incorrect, you can use transactions to undo the first two results.

    If you don't use it, it's likely to be inconsistent with the business.

  8. Anonymous users2024-01-29

    First of all, you need to understand what a rollback is.

    For example, I have an order, and there is information about a hundred products in the order, and I want to insert this order into the database, so if I don't use transactions, insert them one by one, and when I insert the 50th, I wipe it, and the network is disconnected... Then you are now in an embarrassing situation, the 50 pieces of data is not a complete data, maybe others will query this order and say: "Hey, no, I obviously have 100 products in this order, why only 50".

    If you use a transaction, it is to submit the insertion operation of these 100 commodities at one time, if there is an exception in the middle, none of these 100 commodities will be inserted into the database, and you can also call rollback to roll back the database to the state before the insertion operation.

    In addition, to tell you secretly: using transactions to commit operations at once is much more efficient than inserting delete modifications one by one in a loop (if you don't believe it, you can experiment with it).

  9. Anonymous users2024-01-28

    connectionstring="datasource=.\sqlexpress;

    initial

    catalog=cecdom;

    integrated

    security=true;user

    id=sa;password=lsyuan";

    Here's an example of a connection string that doesn't have the server name in it, i.e. "datasource."

    That paragraph. If you're not familiar, you can use the wizard to create a connection.

    followed by sqlcommand

    is a stored procedure, pay attention to check whether the parameters correspond.

  10. Anonymous users2024-01-27

    Transactions are used when multiple SQL statements are required to complete a task.

  11. Anonymous users2024-01-26

    It means that the database execution object is bound to a specific SQL, so you need to create a new cmd object each time.

  12. Anonymous users2024-01-25

    See if the database engine of the database is innerdb

Related questions
32 answers2024-02-08

Ah, a sigh.

It's useless to scold, this society is like that. >>>More

38 answers2024-02-08

This is not necessarily, it depends on how the two of you develop, if you think that both of you are together, you can live together, you can get married, if you feel that two people are not compatible, you don't need to get married, otherwise you will be unhappy before marriage.

20 answers2024-02-08

In fact, it is related, the most able to sing high notes is indeed the type in ancient times is a nomadic people, (such as Mongolia) in the steppe need to shout each other, the pitch must be high, otherwise the other party can't hear. >>>More

7 answers2024-02-08

A low-cost strategy doesn't necessarily mean poor quality. >>>More

10 answers2024-02-08

From the perspective of endosymbiotic, the chloroplasts in modern higher plants or lower eukaryotic photosynthetic algae actually come from cyanobacteria. In other words, in the long evolutionary process, the ancestors of plant cells swallowed cyanobacteria and found that they could photosynthesize to provide energy, so they kept them in their bodies. After a long time, cyanobacteria gradually lose other functions that have nothing to do with photosynthesis, and the whole becomes a part of the plant cell. >>>More