当前位置: 首页>>代码示例>>C#>>正文


C# Data.SqlHelper类代码示例

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


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


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