打印本文 打印本文 关闭窗口 关闭窗口
ASP.NET中自定义控件的创建和使用
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2777  更新时间:2009/4/23 10:47:07  文章录入:mintao  责任编辑:mintao
sp;     break;

                case SortType.LastName:

                    strType="LastName";

                    break;

                case SortType.Title:

                    strType="Title";

                    break;

                case SortType.TitleOfCourtesy:

                    strType="TitleOfCourtesy";

                    break;

                default:

                    strType="undefine";

                    break;

            }

 

            switch(psortStyle)

            {

                case SortStyle.asc:

                    strStyle="asc";

                    break;

                case SortStyle.desc:

                    strStyle="desc";

                    break;

                default:

                    strStyle="undefine";

                    break;

            }

 

            sql="select * from Employees order by "+ strType + " " + strStyle;

           

            SqlConnection con=new SqlConnection("server=accp-lzh;uid=sa;pwd=sasa;database=Northwind");

            SqlCommand cmd=con.CreateCommand();

            cmd.CommandType=CommandType.Text;

            cmd.CommandText=sql;

 

            SqlDataAdapter ada=new SqlDataAdapter();

            ada.SelectCommand=cmd;

            DataSet ds=new DataSet();

 

            con.Open();

            ada.Fill(ds,"Employees");

            con.Close();

 

            return ds;

        }

    }

}

 

2、  保存

上一页  [1] [2] [3] [4] [5]  下一页

打印本文 打印本文 关闭窗口 关闭窗口