易截截图软件、单文件、免安装、纯绿色、仅160KB

datagirdview和listview,删改查sqlserver数据库的小结

        //创建DBhelper数据库链接文件
        private static string sqlcon = "server=.;database=myschool;uid=sa;pwd=sa";
        public static SqlConnection connection = new SqlConnection(sqlcon);
============================================================
            //首先是lv控件的列表显示 ,(listview)
            // 清空当前lv表中内容
            listview.Items.Clear();
            string sql = "select * from question";
            //引用DBhelper中的数据库链接
            SqlCommand command = new SqlCommand(sql,DBhelper.connection);
            //打开数据库,并用dr读取记录
            DBhelper.connection.Open();
            SqlDataReader dr = command.ExecuteReader();
            while (dr.Read())
            {
                ListViewItem lvi = new ListViewItem(dr["Question"].ToString());
                lvi.SubItems.AddRange(new string[] { dr["Answer"].ToString(), dr["Difficulty"].ToString(), dr["SubjectId"].ToString(), dr["OptionA"].ToString(), dr["OptionB"].ToString(), dr["OptionC"].ToString(), dr["OptionD"].ToString() });
             


相关文档:

SQLServer 优化SQL语句:in 和not in的替代方案


原文出处:http://www.cnblogs.com/luoht/archive/2010/03/01/1676049.html
用IN写出来的SQL的优点是比较容易写及清晰易懂,这比较适合现代软件开发的风格。
  但是用IN的SQL性能总是比较低的,从SQL执行的步骤来分析用IN的SQL与不用IN的SQL有以下区别:
  SQL试图将其转换成多个表的连接,如果转换不成功则先执行 ......

sqlserver 基础知识大整理

--(开启SQL服务:net start mssqlserver)
--(在命令行中输入'sqlwb'命令可打开SQL管理器 )
--(如果要执行多条命令中的一条,鼠标选定后再按F5执行)
create database sales                       & ......

SQLServer和Oracle的常用函数对比

1.绝对值
S:select abs(-1) value
O:select abs(-1) value from dual
2.取整(大)
S:select ceiling(-1.001) value
O:select ceil(-1.001) value from dual
3.取整(小)
S:select floor(-1.001) value
O:select floor(-1.001) value from dual
4.取整(截取)
S:select cast(-1.002 as int) value
O:selec ......

SQLServer DBA常見問題

In the latest installment of the SQL Server interview questions, we will outline questions suitable for a DBA interview to assess the candidates skills related to SQL Server system databases. In this tip, the questions are there to read, but the answers are intentionally hidden to really test your s ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号