• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Data.SqlHelper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Data.SqlHelper的典型用法代码示例。如果您正苦于以下问题:C# SqlHelper类的具体用法?C# SqlHelper怎么用?C# SqlHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SqlHelper类属于System.Data命名空间,在下文中一共展示了SqlHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ControlPointGroup

 /// <summary>
 /// 控制分组带参构造
 /// </summary>
 /// <param name="Connection"></param>
 public ControlPointGroup(string Connection)
 {
     DbConnection = new SqlHelper(Connection);
     GroupType = 0;
     GroupName = "NULL";
     Remarks = "NULL";
 }
开发者ID:kzmmkou,项目名称:ProgramRoadCenter,代码行数:11,代码来源:ControlPointGroup.cs


示例2: DumpHgbstLists

		public static void DumpHgbstLists(params string[] listNames)
		{
			var sqlHelper = new SqlHelper();
			DataSet listDs;

			if (listNames == null || listNames.Length == 0 || (listNames.Length == 1 && listNames[0].Trim().Length == 0))
			{
				sqlHelper.CommandText = "SELECT * FROM table_hgbst_lst";
				listDs = sqlHelper.ExecuteDataSet();
			}
			else
			{
				var names = new object[listNames.Length];
				string colName = null;
				const string hgbstListSql = "SELECT * FROM table_hgbst_lst WHERE (title IN({0}))";

				Array.Copy(listNames, 0, names, 0, listNames.Length);

				sqlHelper.CommandText = String.Format(hgbstListSql, SqlHelper.IN_LIST_TOKEN);
				listDs = sqlHelper.ExecuteDataSetInList(names, colName);
			}

			if (listDs == null || listDs.Tables.Count == 0 || listDs.Tables[0].Rows.Count == 0)
			{
				var namesCombined = (listNames == null) ? "" : String.Join("', '", listNames);
				Console.WriteLine("No HGBST lists found matching the specified criteria ('{0}').", namesCombined);

				return;
			}

			DumpHgbstLists(listDs);
		}
开发者ID:DovetailSoftware,项目名称:hgbst-utils,代码行数:32,代码来源:HgbstUtil.cs


示例3: PlaneIntersection

 public PlaneIntersection(string Connection)
 {
     DbConnection = new SqlHelper(Connection);
     Stake = "NULL";
     PlaneInterName = "NULL";
     bCalcLeft = 0;
     LeftBt = 0;
     LeftL = 0;
     LeftR1 = 0;
     LeftR2 = 0;
     LeftR3 = 0;
     LeftR4 = 0;
     LeftW1 = 0;
     LeftW2 = 0;
     LeftW3 = 0;
     LeftW4 = 0;
     bCalcRight = 0;
     RightBt = 0;
     RightL = 0;
     RightR1 = 0;
     RightR2 = 0;
     RightR3 = 0;
     RightR4 = 0;
     RightW1 = 0;
     RightW2 = 0;
     RightW3 = 0;
     RightW4 = 0;
     Remarks = "NULL";
 }
开发者ID:kzmmkou,项目名称:ProgramRoadCenter,代码行数:29,代码来源:PlaneIntersection.cs


示例4: VerticalSectionGroundLine

 public VerticalSectionGroundLine(string Connection)
 {
     DbConnection = new SqlHelper(Connection);
     SerialNumber = 0;
     Stake = "NULL";
     H = 0;
 }
开发者ID:kzmmkou,项目名称:ProgramRoadCenter,代码行数:7,代码来源:VerticalSectionGroundLine.cs


示例5: CrossSectionDesignLineData

 /// <summary>
 /// 设计横断面地面线数据带参构造 
 /// </summary>
 /// <param name="Connection"></param>
 public CrossSectionDesignLineData(string Connection)
 {
     DbConnection = new SqlHelper(Connection);
     SerialNumber = 0;
     Stake = "NULL";
     H = 0;
 }
开发者ID:kzmmkou,项目名称:ProgramRoadCenter,代码行数:11,代码来源:CrossSectionDesignLineData.cs


示例6: Delete

 public void Delete(int id)
 {
     using (SqlHelper sqlh = new SqlHelper(@"
     delete from Access.role
     where role = @Id"))
     {
         sqlh.ExecNoQuery();
     }
 }
开发者ID:BaTpyLLI,项目名称:IS,代码行数:9,代码来源:RoleRepository.cs


示例7: ControlPoint

 /// <summary>
 /// 控制点带参构造 
 /// </summary>
 /// <param name="Connection"></param>
 public ControlPoint(string Connection)
 {
     DbConnection = new SqlHelper(Connection);
     Name = "NULL";
     X = 0;
     Y = 0;
     H = 0;
     Remarks = "NULL";
 }
开发者ID:kzmmkou,项目名称:ProgramRoadCenter,代码行数:13,代码来源:ControlPoint.cs


示例8: GradeChangePoint

 public GradeChangePoint(string Connection)
 {
     DbConnection = new SqlHelper(Connection);
     SerialNumber = 0;
     Stake = "NULL";
     H = 0;
     R = 0;
     i1 = 0;
     i2 = 0;
 }
开发者ID:kzmmkou,项目名称:ProgramRoadCenter,代码行数:10,代码来源:GradeChangePoint.cs


示例9: Culvert

 /// <summary>
 /// 涵洞带参构造 
 /// </summary>
 /// <param name="Connection"></param>
 public Culvert(string Connection)
 {
     DbConnection = new SqlHelper(Connection);
     CenterStake = "NULL";
     CulvertName = "NULL";
     StructureFrom = 0;
     Angle = 0;
     BottomH = 0;
     SpanDescription = "NULL";
 }
开发者ID:kzmmkou,项目名称:ProgramRoadCenter,代码行数:14,代码来源:Culvert.cs


示例10: VerticalCurv

 //初始化竖曲线构造函数
 public VerticalCurv(string Connection)
 {
     DbConnection = new SqlHelper(Connection);
     VerticalCurveType = 0;
     GradeChangePointNumber = 0;
     CurveNumber = 0;
     VerticalCurveLength = 0;
     BeginStake = "NULL";
     EndStake = "NULL";
     Description = "NULL";
 }
开发者ID:kzmmkou,项目名称:ProgramRoadCenter,代码行数:12,代码来源:VerticalCurve.cs


示例11: BuildingBlockCurve

 /// <summary>
 /// 积木法带参构造 
 /// </summary>
 /// <param name="Connection"></param>
 public BuildingBlockCurve(string Connection)
 {
     DbConnection = new SqlHelper(Connection);
     SerialNumber = 0;
     Stake = "NULL";
     X = 0;
     Y = 0;
     Azimuth = 0;
     TurnTo = 0;
     R = 0;
     Description = "NULL";
 }
开发者ID:kzmmkou,项目名称:ProgramRoadCenter,代码行数:16,代码来源:BuildingBlockCurve.cs


示例12: EmailBLL

        public EmailBLL()
        {
            _currentPath = GetType().Assembly.Location;
            _currentPath = _currentPath.Substring(0, _currentPath.LastIndexOf(@"\")) + "\\";
            string mailConfigPath = _currentPath + @"ConfigFiles\MailConfig.xml";

            string connFile = _currentPath + @"ConfigFiles\CommonConfig.xml";
            string connStr = new XmlHelper(connFile).GetValue("ConnectionString");
            _sqlHelper = new SqlHelper(connStr);

            _xmlHelper = new XmlHelper(mailConfigPath);
        }
开发者ID:shakasi,项目名称:shakasi.github.com,代码行数:12,代码来源:EmailBLL.cs


示例13: Get

 /// <summary>
 /// Получает роль по идентификатору.
 /// </summary>
 /// <param name="id">Идентификатор.</param>
 /// <returns>Роль.</returns>
 public RoleItem Get(int id)
 {
     using (var sqlh = new SqlHelper())
     {
         return sqlh.ExecMapping<RoleItem>(@"
     select
     r.role Id,
     r.code Code,
     r.mem Mem
     from Access.role r
     where r.role = @Id", new { id });
     }
 }
开发者ID:dha01,项目名称:IS,代码行数:18,代码来源:RoleRepository.cs


示例14: Tunnel

 public Tunnel(string Connection)
 {
     DbConnection = new SqlHelper(Connection);
     Stake = "NULL";
     StartStake = "NULL";
     EndStake = "NULL";
     Type = 0;
     Name = "NULL";
     Angle = 0;
     LeftWidth = 0;
     RightWidth = 0;
     SpanDescription = "NULL";
 }
开发者ID:kzmmkou,项目名称:ProgramRoadCenter,代码行数:13,代码来源:Tunnel.cs


示例15: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Clear();

            string str_sql = "";
            IDbHelper sql = GetHelper();
            DbDataReader rd = sql.ExecuteReader(CommandType.Text, "select [name] from sysobjects where xtype='U'");
            while (rd.Read())
            {
                string tableName = rd["name"].ToString();
                if (tableName.ToLower() == "sysuser")
                {
                    continue;
                }

                IDbHelper Helper = new SqlHelper(Voodoo.Setting.DataBase.ConnStr);
                DataTable dt = Helper.ExecuteDataTable(CommandType.Text, string.Format("select * from [{0}]",tableName));

                string str_insert = string.Format("SET IDENTITY_INSERT [{0}] ON ;\n insert into [{0}](", tableName);
                for (int i = 0; i < dt.Columns.Count; i++)
                {
                    str_insert += "[" + dt.Columns[i].ColumnName + "]";
                    if (i != dt.Columns.Count - 1)
                    {
                        str_insert += ",";
                    }
                }
                str_insert += ") values(";

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    str_sql += str_insert;
                    for (int j = 0; j < dt.Columns.Count; j++)
                    {
                        str_sql += "N'" + dt.Rows[i][j].ToString().Replace("'", "''") + "'";
                        if (j != dt.Columns.Count - 1)
                        {
                            str_sql += ",";
                        }
                    }
                    str_sql += string.Format(")\n SET IDENTITY_INSERT [{0}] OFF ;\n\n\n",tableName);
                }
            }
            rd.Close();
            rd.Dispose();

            //Response.Write(str_sql);
            Voodoo.IO.File.Write(Server.MapPath("~/e/installer/tabledata.txt"), str_sql, System.IO.FileMode.Create);
            Response.Write("已经生成到:" + Server.MapPath("~/e/installer/tabledata.txt"));
            Response.End();
        }
开发者ID:kuibono,项目名称:KCMS2,代码行数:51,代码来源:gettabledata.aspx.cs


示例16: IntersectionPoint

 public IntersectionPoint(string Connection)
 {
     DbConnection = new SqlHelper(Connection);
     SerialNumber = 0;
     JDBH = "NULL";
     Stake = "NULL";
     X = 0;
     Y = 0;
     R = 0;
     Ls1 = 0;
     Ls2 = 0;
     Ls1R = 0;
     Ls2R = 0;
 }
开发者ID:kzmmkou,项目名称:ProgramRoadCenter,代码行数:14,代码来源:IntersectionPoint.cs


示例17: Create

        public int Create(RoleItem role)
        {
            using (SqlHelper sqlh = new SqlHelper(@"
            insert into Access.role(code, mem)
            values (@Code, @Mem)

            select SCOPE_IDENTITY()
            "))
            {
                sqlh.AddWithValue("@Code", role.Code);
                sqlh.AddWithValue("@Mem", role.Mem);
                return (int)sqlh.ExecScalar();
            }
        }
开发者ID:BaTpyLLI,项目名称:IS,代码行数:14,代码来源:RoleRepository.cs


示例18: RoadWidthChange

 public RoadWidthChange(string Connection)
 {
     DbConnection = new SqlHelper(Connection);
     SerialNumber = 0;
     Stake = "NULL";
     LeftSoilShoulder = 0;
     LeftHardShoulder = 0;
     LeftCarriageway = 0;
     LeftMiddle = 0;
     RightMiddle = 0;
     RightCarriageway = 0;
     RightHardShoulder = 0;
     RightSoilShoulder = 0;
     Remarks = "NULL";
 }
开发者ID:kzmmkou,项目名称:ProgramRoadCenter,代码行数:15,代码来源:RoadWidthChange.cs


示例19: Contact

        public ActionResult Contact()
        {
            ViewBag.Message = "與我們聯絡";

            /*
            List<string> DepartmentList = new List<string>();
            DepartmentList.Add("業務部");
            DepartmentList.Add("創意部");
            DepartmentList.Add("行銷部");

            ViewBag.DepartmentList = DepartmentList;

            return View();

            */

            List<department> departmentlist = new List<department>();

            SqlHelper hp = new SqlHelper();

            DataTable tb = hp.Sql2Table("select id,cname from dep");

            department depobj;
            foreach(DataRow r in tb.Rows)
            {
                depobj = new department();
                depobj.id = r["id"].ToString();
                depobj.departmentName = r["cname"].ToString();
                departmentlist.Add(depobj);
            }

            //return View(departmentlist);

            departmentlist.Clear();
            depobj = new department();
            depobj.id = "a001"; depobj.departmentName = "業務部";
            departmentlist.Add(depobj);

            depobj = new department();
            depobj.id = "a002"; depobj.departmentName = "創意部";
            departmentlist.Add(depobj);

            depobj = new department();
            depobj.id = "a003"; depobj.departmentName = "行銷部";
            departmentlist.Add(depobj);

            return View(departmentlist);
        }
开发者ID:hahalin,项目名称:mvc_tutorial,代码行数:48,代码来源:HomeController.cs


示例20: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            m_sqlHelper = new SqlHelper();

            string P_id = Request.QueryString["P_id"];
            //string P_id = "054321";

            string commandText = "select distinct Paper.Introduction as 选题简介 " +
                                 "from Paper " +
                                 "where P_id = " + P_id;

            DataTable dt = m_sqlHelper.Query(commandText);

            m_introductionGridView.DataSource = dt;
            m_introductionGridView.DataBind();
        }
开发者ID:2011052403,项目名称:Defence,代码行数:16,代码来源:StuTitleSelectForm2.aspx.cs



注:本文中的System.Data.SqlHelper类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Data.StateChangeEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Data.Select类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap