摘要:
一.用SqlConnection连接SQLServer1.加入命名空间usingSystem.Data.SqlClient;2.连接数据库SqlConnectionmyConnection=newSqlConnection();myConnection.ConnectionString="userid=sa;password=sinofindb;initialcatalog=test;dataso... 阅读全文
摘要:
Access:select top n * from table order by rnd(id)'id为数据库的自动编号字段Sql Server:select top n * from table order by newid() 阅读全文
摘要:
1.SqlConnectionthisConnection=newSqlConnection();thisConnection.Open(StrConn);SqlCommandthisCommand=thisConnection.CreateCommand();//命令类型为存储过程thisCommand.CommandType=CommandType.StoredProcedure;//存储过程... 阅读全文