Use C to determine whether the SQL server is started

Updated on technology 2024-05-17
14 answers
  1. Anonymous users2024-02-10

    You can take a look at this paragraph**, I believe it should be useful. Judge before connecting, close the connection and then reopen it if it is open, and open it directly if it is not.

    private static sqlconnection connection;

    public static sqlconnection connection

    getstring connectionstring = @"";Database connection statements.

    if (connection == null)

    connection = new sqlconnection(connectionstring);

    else if ( ==

    else if ( ==

    return connection;

  2. Anonymous users2024-02-09

    This one seems to only throw an exception.

    There is no specific way to determine whether there is a database started or not.

  3. Anonymous users2024-02-08

    Implement it with the following **Implementation,**.

    public static bool testrun(string cmd, ref string str)

    process p = new process();

    false;

    true;true;

    true;true;

  4. Anonymous users2024-02-07

    If it is connected, it means that it is started, but it is not connected when an error is reported.

  5. Anonymous users2024-02-06

    using system;

    using ;

    using ;

    using ;

    using ;

    namespace baiduexample) != null)

    is a database instance", servername, isloalip ? "Local" : "Remotely"));Output the result.

  6. Anonymous users2024-02-05

    This question can be considered in this way. Because c itself runs on the server side, which means that the program is on the server no matter how it is judged. Relative to it is local.

    From the server's perspective, SQL is local. From the client's point of view, it's remote. How do you say?

    Hehe, the above is my understanding. Errors are also understood.

  7. Anonymous users2024-02-04

    Look at the IP address.

    If it's local or it's local.

    If it's not two, it's remote.

  8. Anonymous users2024-02-03

    1l Don't mislead. It's just a loopback address. If you fill in the actual IP of the machine, or the name of the machine, do you still judge it like this?

    I don't know why you need it, though. If you want to achieve something, it's best to think differently.

  9. Anonymous users2024-02-02

    private sqlconnection conn;

    public sqlconnection conngetstring stringconn = data source=.;initial catalog=lhhdb;persist security info=true;user id=sa;password=fubing";

    if (conn ==null) if the connection is empty. Just create one.

    conn = new sqlconnection(stringconn);

    else if ( == If the connection is corrupted, close it in the On {;

    else if ( == ON if it is off.

    return conn;

    I don't know if the landlord means that.

  10. Anonymous users2024-02-01

    You seem to be making a secondary menu. The first level is the database name, and the second level is all the tables in the corresponding database.

  11. Anonymous users2024-01-31

    Query the database name.

    In the master database, select name from all tables in a certain database, and query select * from in this database, if you want to check others, you can i in where type=?

  12. Anonymous users2024-01-30

    select [name] from [sysdatabases] order by [name]

    By the way, I'll send you one to see all the tables.

    select [id], name] from [sysobjects] where [type] = 'u' order by [name]

  13. Anonymous users2024-01-29

    Upstairs is right, it can be loaded with SQL statements.

  14. Anonymous users2024-01-28

    sqlconnection conn = new sqlconnection(constr);

    If. Plagiarism is plagiarism off the state.

    if ( ==

Related questions
13 answers2024-05-17

You go to the service manager to see if any service is being shut down. Control Panel - Management Tools - Computer Management Panel, there is a service and application in it, open the service panel, you can see the startup status of the series of services on the right, mainly whether the mssqlsever service is started, and then you try to modify the startup state. >>>More

25 answers2024-05-17

Vista can install only SQL Server 2005 SP2 or later. When installing SQL Server 2005, it will prompt that it is incompatible, but you can continue to install, and go to Microsoft's official website after installation** SQL Server 2005 Service Pack 2 Patch Package, and you can use it after you put it on. >>>More

12 answers2024-05-17

You can consider the United States T2 for multi-IP station servers in the United States, which is very good, the mainland connection is stable, the IP is sufficient, the IP is super cheap, and it is suitable for the station group.

5 answers2024-05-17

It may be that the SQL Server service has not been started, just start the service in the configuration manager!

30 answers2024-05-17

This has a small point of complexity, after turning on the 220 volt power supply, use the multimeter DC gear to detect the small 24 feet, find the 3 volt or so line should have several all marked out, and then use Feng Ming to find the iron foot from the 24 small feet, turn on the table will call, and then use the 3 volt foot line detected before to connect the iron foot, any that tie can be, the 3 volt line one by one check, know that the fan rotates, this line is the start line, At this time, the line on the high-current foot is not any voltage, in the remaining 3-volt wire to contact the lap iron leg one by one test, know that the voltage on the high-current foot, the 3-volt line can touch any lap foot, but can not touch the 12-volt foot after the fan rotates, otherwise the power supply is broken, remember to remember.