Select XH, Coun (*) CNT from lqk group by XH having count (*)> 1
Sele s1.xh from lqk S1, lqk S2 wher s1.ksh <> s2.ksh and s1.xh = s2.xh
Create several custom columns in the gridview, obtain the values in the background, write a stored procedure, and store data in the database,
In fact, there is a good method.
1. Create a file first. Null. Only the. udl file is required. For example, ABC. udl.
2. Double-click the file to display a database connection interface.
3. Set it in this interface and save it. Remember to save the password.
4. open the file in a text editor. The string is the link string you want.
Of course, remember to delete this file after use. Because there is data in it.
@ "Datasource =./sqlexpress; attachdbfilename = | datadirectory |/chengji. MDF; Integrated Security = true; user instance = true ";
<Deleetask>
<Add key = "connstr" value = "Data Source =./sqlexpress; attachdbfilename = | datadirectory |/news. MDF; Integrated Security = true; user instance = true"/>
</Appsettings>
Add between <configuration>
<Deleetask>
<Add key = "sqlconnectionstring" value = "Server = localhost; uid = sa; Pwd =; database = sqldataname;"/>
</Appsettings>
Use the following statement when calling
String connstr = configurationsettings. etettings ["sqlconnectionstring"];
Sqlconnection sqlconn = new sqlconnection (connstr );
Sqlconn. open (); // open the connection
...
Sqlconn. Close (); // close the connection