What parameters are required for the database access class

Updated on technology 2024-05-15
6 answers
  1. Anonymous users2024-02-10

    Landlord, there is a class in the framework that is used to connect, and the function is as you described.

    It's right under the namespace. Commonly used classes in this namespace are the following: sqlconnection class: used to establish a connection to the database.

    sqlcommand class l: used to pass commands.

    There are also things like sqldatareader, sqldataadapter, etc., which are more commonly used, and it is a long article to say, and the effect will not be very good, thankless errands

    I'll send you msdn**,You go to the top to check it.,There are examples in it.,If you don't know how to use it, hit the names of these classes in a search.,There's a lot of examples.,I'm not verbose.。

    msdn**。

    Hehe, I don't know much. Hope it works for you.

  2. Anonymous users2024-02-09

    What database do you have?

    SQLSer is used for sqlserver.

    If it's an oracle, use oraclehelper.

    Forehead.. This requirement is more complicated, hehe, it is better to use the ORM framework for this need.

  3. Anonymous users2024-02-08

    1. Where all the principles of interface programming and dependency inversion are used, if these techniques are used, your program calls the methods of the interface and the abstract class, but the interface and the abstract class cannot be instantiated with new, so you have to use the factory to create an instance, and in other places, if you call the methods of the concrete class, you don't need to use the factory class, just new

  4. Anonymous users2024-02-07

    The differences between static and normal classes are as follows:

    1) Static classes can't be instantiated, while normal classes can;

    2) static classes can only inherit from the base class; Normal can inherit any other non-static and non-sealed classes, but can only inherit one class;

    3) Static classes cannot inherit interfaces; A normal class can inherit from multiple interfaces;

    4) Static classes can only contain static members; Normal classes can contain both static and non-static members;

    5) Static classes cannot be used as fields, method parameters and local variables; The general class can;

  5. Anonymous users2024-02-06

    I don't know what you mean, but here's how I call a stored procedure.

    string conns = "connstr"].connectionstring;

    sqlconnection conn = new sqlconnection(conns);

    sqlcommand cmd = new sqlcommand("lianjie",conn);

    "@u", ,20);

    u"].value = t_;

    p", ,20);

    p"].value = t_;

  6. Anonymous users2024-02-05

    When you create a table in your database. Let's say a field is of type int! And then when you write it in the program. It has to be the same as the database!

    username int primary key ,sqlparameter param1 = new sqlparameter("@username", ;

    Both types should be the same!

Related questions
6 answers2024-05-15

The structure of the storage is the main basis for classifying the types of copy databases. In today's Internet, databases are usually divided into two categories, namely relational and non-relational databases. >>>More

11 answers2024-05-15

The deletion operation in the data is irreparable, sometimes the data in the data table may be deleted due to misoperation, or the database crashes for other reasons, and all the data is lost, especially when there is a large amount of useful data in the database, then it is impossible for you to enter the data again from the beginning, this is the role of the backup database, back up the database, when the above situation occurs, you can restore the previous database through the backup file.

8 answers2024-05-15

2. At present, there are three types of databases used in **, including soft access, mssql and mysql of sybase. They have their own advantages, and they are suitable for use in different conventions and languages. For example, most of the small and medium-sized asp** use access data stacks, and php** jujube grips mostly use mysql >>>More

11 answers2024-05-15

Key features: 1) Realize data sharing.

Data sharing includes all users who can access the data in the database at the same time, and also includes users who can use the database through interfaces in various ways and provide data sharing. >>>More

9 answers2024-05-15

Of course, the status is very high.

Although it is also a file, it has the advantage of storing a large amount of data and is easy to use. >>>More