-
Violating the principle of opening and closing... You can spell out the string as m978718484 says and then do the in operation, or you can "select col from table where key=1 union select col from table where key=2.""union is faster than iterating through the database, and it's a single execution.
-
You take out the data in the arraylist loop, put it in the string, use it, separate, and then use in when you look it up, which will be faster, and the interaction with the database will be reduced.
-
First, use the query tool that comes with the database itself to execute your query statement to see if there are any errors.
-
If it is a web program, frequent opening and closing cannot be avoided, because the access requirements initiated by each client are different, if the program starts to open the connection uniformly, and closes the connection when it is closed, it will cause the occupation of database system resources and affect the client's access to server resources.
-
No, there's something called a connection pool, so let's find out!
-
1. There is little data, you can do anything, and it has little impact on the speed (mainly because you can't feel it).
2. There is a lot of data, multi-table connection query is faster than multiple queries, multiple queries need to call classes many times to operate, and multi-change connection queries, only need to call classes once, but in both cases, it takes a certain amount of time, it is recommended to use thread rest commands when querying, give hints, etc., so that query design is more humane.
-
The conditions are too vague, how many tables, how many times to access the database! And how big your database is, if it's very small, it doesn't make much difference!
-
Hehe. According to your will. I recommend you to look it up with a statement.
Database links are invaluable. It's mainly a matter of SQL optimization. I once wrote a sql to solve a problem.
It takes a minute to get results. Write in two. Just over 2 seconds.
-
Do you mean that you have multiple visits to find out some of the data first, and then filter it according to the criteria?
I think unless you have a very large amount of data, or a statement multi-table join query, if your data is so large that it takes longer than multiple connections, then connect multiple times, test it and get your answer.
-
If you read it without modification. Data can be read out and cached.
Write frequently. You can splice multiple statements of a statement. A sex is passed into the database.
Multiple statements are executed. Database transactions are turned on. This will be more efficient.
-
string sql=select count(*)from table where condition='';
Then write a method that returns a single number, and then the foreground adjusts the method and displays it in the textbox
-
Join as a sqlserver database:
using ;
using ;
sqlconnection conn = new sqlconnection(connectionstring);
sqlcommand cmd = new sqlcommand("secelt * from userinfo", conn);
sqldataadapter sda = new sqldataadapter(cmd);
dataset ds = new dataset();
table");
return "table"];A datatable is returned
-
dataset ds = new dataset();
datatable dt = new datatable();
dt = ;In this case, there is no datatable in the dataset, so an error will be reported here.
change to dataset ds = new dataset();
datatable dt = new datatable();
Or put. dataset ds = new dataset();
dt = ;
These two sentences are commented out, and then ; Changed to;
-
You mean a lot of basic data, which should be used a lot of data and don't change much. It's better to keep this data in memory, which is quick to access and doesn't require frequent database connections.
-
It depends, the memory is limited but the speed is fast, and the database is large but the speed is slow.
Just like the relationship between CPU and memory, memory and hard disk, it all depends on your practical application.
-
In the actual program design, to analyze the reading frequency of this data, but also consider the carrying capacity of the server, improve efficiency is king.
The reading frequency is high, and the frequency of use is also high, and the basic data is generally loaded and used many times at one time (filtering, reprocessing, etc.), so it is recommended to save it in memory.
Stored in the database takes a long time to read, and if the number of concurrent transactions is high, it will affect the efficiency even more.
-
It depends on how much data you use, how much you use it, and how long you use it, if you use it multiple times in a short period of time, it is recommended to save it to memory, and if you don't use it very frequently, then access the database every time.
-
If it's data that is used frequently and the memory is sufficient, putting it in memory can improve efficiency and reduce the pressure on the database.
-
It can't be so simple!
First of all, it depends on whether the data you cache needs to be queried intervals.
Then look at the amount of data cached.
If you do not need to query between regions, no matter how large the amount of data is, it is fast to put it in memory, if you need to query between sections and the amount of data is not large (for example, below 10,000 levels), it is still fast to put it in memory, and if the data volume is large (such as more than 10,000 levels), it is still fast to put it in the database.
Because in terms of big data processing power, c ** is far inferior to the database!
-
Millions of data, preferably with less access to the database.
Below millions, you can do so by querying the database.
-
If the server is good, it is recommended to read the database.
-
Your question is too general, let me think about it:
Use C to call a query: select count(*)from your table where your field = the value you are looking for, use the executescalar method of the sqlcommand object to adjust, if the return value is greater than 0, it means that the value exists in the database, then you can prompt the repeat in the way you need.
-
What do several values of the same field mean, and what are the characteristics, you can use SQL statements to achieve them, such as select field name from table name where condition, where the condition is determined according to the value you want to query, such as like, in, etc.
Try to capture the return value.
Author: Xiao Kuan] private void restore().
string path = recovery path. text;Obtain the backup path and database name. >>>More
1.Create a socket
2.Determine the local computer endpoint (IP and port number). >>>More