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

C# SqlTypes.SqlDateTime类代码示例

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

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



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

示例1: cArticle

 public cArticle(SqlString artName, SqlString artField, SqlString artMag, SqlDateTime artDate)
 {
     strName = artName;
     strField = artField;
     strMagazine = artMag;
     dtmDate = artDate;
 }
开发者ID:hoaian89,项目名称:DAA,代码行数:7,代码来源:advControl.cs


示例2: TabRescenCourseInfo

        /// <summary>
        /// full constructor 
        /// </summary>
        ///
        public TabRescenCourseInfo(String FCourseId_0, String FCourseName_1,
				String FCourseNo_2, String FParentId_3, Int32 FSortCode_4,
				String FCoursePath_5, String FCoursetypeId_6, Int32 FCourseformatId_7,
				String FSupplierId_8, String FSysuserId_9, SqlDateTime FCreateTime_10,
				String FTecherName_11, String FLevelId_12, Int32 FChapterNums_13,
				Int32 FCourseScores_14, Int32 FCourseHours_15, Double FStudyDuration_16,
				Double FCoursePrice_17, String FCourseDesc_18, Int32 FVerifyStatus_19,
				Int32 FUseStatus_20, Int32 FIsSell_21)
        {
            this.FCourseId = FCourseId_0;
            this.FCourseName = FCourseName_1;
            this.FCourseNo = FCourseNo_2;
            this.FParentId = FParentId_3;
            this.FSortCode = FSortCode_4;
            this.FCoursePath = FCoursePath_5;
            this.FCoursetypeId = FCoursetypeId_6;
            this.FCourseformatId = FCourseformatId_7;
            this.FSupplierId = FSupplierId_8;
            this.FSysuserId = FSysuserId_9;
            this.FCreateTime = FCreateTime_10;
            this.FTecherName = FTecherName_11;
            this.FLevelId = FLevelId_12;
            this.FChapterNums = FChapterNums_13;
            this.FCourseScores = FCourseScores_14;
            this.FCourseHours = FCourseHours_15;
            this.FStudyDuration = FStudyDuration_16;
            this.FCoursePrice = FCoursePrice_17;
            this.FCourseDesc = FCourseDesc_18;
            this.FVerifyStatus = FVerifyStatus_19;
            this.FUseStatus = FUseStatus_20;
            this.FIsSell = FIsSell_21;
        }
开发者ID:unconquered,项目名称:client,代码行数:36,代码来源:TabRescenCourseInfo.cs


示例3: Box

 public static object Box(SqlDateTime a)
 {
     if (a.IsNull)
         return null;
     else
         return a.Value;
 }
开发者ID:valery-shinkevich,项目名称:sooda,代码行数:7,代码来源:SoodaNullable.cs


示例4: SqlDateTimeTest

 public SqlDateTimeTest()
 {
     CultureInfo.CurrentCulture = new CultureInfo("en-US");
     _test1 = new SqlDateTime(2002, 10, 19, 9, 40, 0);
     _test2 = new SqlDateTime(2003, 11, 20, 10, 50, 1);
     _test3 = new SqlDateTime(2003, 11, 20, 10, 50, 1);
 }
开发者ID:dotnet,项目名称:corefx,代码行数:7,代码来源:SqlDateTimeTest.cs


示例5: SqlDateTime

 public SqlDateTime(int year, int month, int day, int hour, int minute, int second, double millisecond)
 {
     if (((year >= MinYear) && (year <= MaxYear)) && ((month >= 1) && (month <= 12)))
     {
         int[] numArray = IsLeapYear(year) ? DaysToMonth366 : DaysToMonth365;
         if ((day >= 1) && (day <= (numArray[month] - numArray[month - 1])))
         {
             int num2 = year - 1;
             int dayTicks = ((((((num2 * 0x16d) + (num2 / 4)) - (num2 / 100)) + (num2 / 400)) + numArray[month - 1]) + day) - 1;
             dayTicks -= DayBase;
             if (((((dayTicks >= MinDay) && (dayTicks <= MaxDay)) && ((hour >= 0) && (hour < 0x18))) && (((minute >= 0) && (minute < 60)) && ((second >= 0) && (second < 60)))) && ((millisecond >= 0.0) && (millisecond < 1000.0)))
             {
                 double num4 = (millisecond * SQLTicksPerMillisecond) + 0.5;
                 int timeTicks = (((hour * SQLTicksPerHour) + (minute * SQLTicksPerMinute)) + (second * SQLTicksPerSecond)) + ((int) num4);
                 if (timeTicks > MaxTime)
                 {
                     timeTicks = 0;
                     dayTicks++;
                 }
                 this = new SqlDateTime(dayTicks, timeTicks);
                 return;
             }
         }
     }
     throw new SqlTypeException(SQLResource.InvalidDateTimeMessage);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:26,代码来源:SqlDateTime.cs


示例6: GetGroupChangeInformationBetweenDates

        public string GetGroupChangeInformationBetweenDates(SqlDateTime begin, SqlDateTime end)
        {
            string blank = "";
            Collection<RequestForm> forms = GetApprovedRequestsBetweenDates(begin, end);
            List<string> groups = _dataRequest.GetAllGroups();
            Dictionary<string, int> groupCount = new Dictionary<string, int>();

            foreach (string entry in groups)
            {
                groupCount.Add(entry, 0);
            }

            foreach (RequestForm entry in forms)
            {
                if (entry != null)
                {
                    string pastGroup = entry.Current.BazookaInfo.Group;
                    string futureGroup = entry.Future.BazookaInfo.Group;
                    if (groupCount.ContainsKey(pastGroup))
                        groupCount[pastGroup]--;

                    if (groupCount.ContainsKey(futureGroup))
                        groupCount[futureGroup]++;
                }
            }

            foreach (string entry in groups)
            {
                if (groupCount[entry] != 0)
                    blank += String.Format("Group {0} changed by {1} people\n", entry, groupCount[entry]);
            }

            return blank;
        }
开发者ID:jakemmarsh,项目名称:coyote-moves,代码行数:34,代码来源:AnalyticsDB.cs


示例7: GetReady

                public void GetReady() 
		{
			Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");
			Test1 = new SqlDateTime (2002, 10, 19, 9, 40, 0);
			Test2 = new SqlDateTime (2003, 11, 20,10, 50, 1);
			Test3 = new SqlDateTime (2003, 11, 20, 10, 50, 1);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:7,代码来源:SqlDateTimeTest.cs


示例8: AddContainerACL

        public static void AddContainerACL(
            SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
            SqlString containerName,
            SqlString containerPublicReadAccess,
            SqlString accessPolicyId,
            SqlDateTime start, SqlDateTime expiry,
            SqlBoolean canRead,
            SqlBoolean canWrite,
            SqlBoolean canDeleteBlobs,
            SqlBoolean canListBlobs,
            SqlGuid LeaseId,
            SqlInt32 timeoutSeconds,
            SqlGuid xmsclientrequestId)
        {
            Enumerations.ContainerPublicReadAccess cpraNew;
            if(!Enum.TryParse<Enumerations.ContainerPublicReadAccess>(containerPublicReadAccess.Value, out cpraNew))
            {
                StringBuilder sb = new StringBuilder("\"" + containerPublicReadAccess.Value + "\" is an invalid ContainerPublicReadAccess value. Valid values are: ");
                foreach (string s in Enum.GetNames(typeof(Enumerations.ContainerPublicReadAccess)))
                    sb.Append("\"" + s + "\" ");
                throw new ArgumentException(sb.ToString());
            }

            AzureBlobService abs = new AzureBlobService(accountName.Value, sharedKey.Value, useHTTPS.Value);
            Container cont = abs.GetContainer(containerName.Value);

            Enumerations.ContainerPublicReadAccess cpra;
            SharedAccessSignature.SharedAccessSignatureACL sasACL = cont.GetACL(out cpra,
                LeaseId.IsNull ? (Guid?)null : LeaseId.Value,
                timeoutSeconds.IsNull ? 0 : timeoutSeconds.Value,
                xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);

            string strPermissions = "";
            if (canRead.IsTrue)
                strPermissions += "r";
            if (canWrite.IsTrue)
                strPermissions += "w";
            if (canDeleteBlobs.IsTrue)
                strPermissions += "d";
            if (canListBlobs.IsTrue)
                strPermissions += "l";

            SharedAccessSignature.AccessPolicy ap = new SharedAccessSignature.AccessPolicy()
            {
                Start = start.Value,
                Expiry = expiry.Value,
                Permission = strPermissions
            };

            sasACL.SignedIdentifier.Add(new SharedAccessSignature.SignedIdentifier()
                {
                    AccessPolicy = ap,
                    Id = accessPolicyId.Value
                });

            cont.UpdateContainerACL(cpraNew, sasACL,
                LeaseId.IsNull ? (Guid?)null : LeaseId.Value,
                timeoutSeconds.IsNull ? 0 : timeoutSeconds.Value,
                xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);
        }
开发者ID:DomG4,项目名称:sqlservertoazure,代码行数:60,代码来源:AzureBlob.cs


示例9: GetReady

                public void GetReady() 
		{
            Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "en-US";
			Test1 = new SqlDateTime (2002, 10, 19, 9, 40, 0);
			Test2 = new SqlDateTime (2003, 11, 20,10, 50, 1);
			Test3 = new SqlDateTime (2003, 11, 20, 10, 50, 1);
		}
开发者ID:tohosnet,项目名称:Mono.Data.Sqlite,代码行数:7,代码来源:SqlDateTimeTest.cs


示例10: ParamDateTimeTemp

 public static SqlDateTime ParamDateTimeTemp(SqlXml Xml, SqlString Name)
 {
     String ValueType;
       String Value = GetValueFromXMLAttribute(Xml, Name, out ValueType);
       if (Value == null) return new SqlDateTime();
       SqlDateTime Result;
       try
       {
     Result = new SqlDateTime(XmlConvert.ToDateTime(Value, XmlDateTimeSerializationMode.RoundtripKind));
       }
       catch (Exception Error)
       {
     throw new System.Exception("Error convert Param = \"" + Name.Value.ToString() + "\" Value = \"" + Value.ToString() + "\" to DateTime: " + Error.Message);
       }
       if (ValueType != null && ValueType != "")
       {
     // year, month, day, hour, minute, second
     switch (ValueType)
     {
       case "1": return Result.Value.Date.AddDays(1);
       default: return Result;
     }
       }
       return Result;
 }
开发者ID:APouchkov,项目名称:ExtendedStoredProcedures,代码行数:25,代码来源:XmlParams.cs


示例11: LocalizeDT

    public static SqlDateTime LocalizeDT(SqlDateTime dt)
    {
        if (dt.IsNull)
               return new SqlDateTime();

          return new SqlDateTime(dt.Value.ToLocalTime());
    }
开发者ID:weavver,项目名称:data,代码行数:7,代码来源:Common.cs


示例12: spGetNewVestaErrands

    public static void spGetNewVestaErrands(SqlDateTime date)
    {
        DateTime d = date.Value;

        String reqStr = String.Format("http://{0}/services/internalSite/errands/sendNewVestaErrandsMails?date={1}",
                                                                                                                                UserDefinedFunctions.fGetWapServerName(), d.ToString("s"));
        SqlContext.Pipe.Send(reqStr);
        HttpWebRequest rq = (HttpWebRequest)WebRequest.Create(reqStr);
        rq.KeepAlive = false;
        XmlDocument xdoc = new XmlDocument();
        using(HttpWebResponse rs = (HttpWebResponse)rq.GetResponse())
        using(Stream stream = rs.GetResponseStream())
                xdoc.Load(stream);
        XmlNode root = xdoc["result"];

        SqlDataRecord rec = new SqlDataRecord(new SqlMetaData("id", SqlDbType.NVarChar, -1),
                                                                                                                                                                new SqlMetaData("text", SqlDbType.NVarChar, -1),
                                                                                                                                                                new SqlMetaData("creator", SqlDbType.NVarChar, -1),
                                                                                                                                                                new SqlMetaData("email", SqlDbType.NVarChar, -1)
                                                                                                                                                            );
        SqlContext.Pipe.SendResultsStart(rec);
        foreach(XmlNode ch in root.ChildNodes)
        {
            rec.SetValues(ch["id"].InnerText,
                                                                    ch["text"].InnerText,
                                                                    ch["creator"].InnerText,
                                                                    ch["email"].InnerText
                                                                    );
            SqlContext.Pipe.SendResultsRow(rec);
        }
        SqlContext.Pipe.SendResultsEnd();
    }
开发者ID:ElectroService,项目名称:SIM,代码行数:32,代码来源:spGetNewVestaErrands.cs


示例13: HR_TimeLogs_TimeSpan

    public static SqlDouble HR_TimeLogs_TimeSpan(SqlDateTime startAt, SqlDateTime endAt)
    {
        if (endAt.IsNull || startAt.IsNull)
               return new SqlDouble();

          TimeSpan duration = endAt.Value.Subtract(startAt.Value);
          return new SqlDouble(duration.TotalSeconds);
    }
开发者ID:weavver,项目名称:data,代码行数:8,代码来源:HR_TimeLogs.cs


示例14: FN_GER_GetWeekOfYear

    public static SqlInt32 FN_GER_GetWeekOfYear(SqlDateTime _date)
    {

        System.Globalization.GregorianCalendar gc = new System.Globalization.GregorianCalendar();


        return _date.IsNull ? SqlInt32.Null : gc.GetWeekOfYear(_date.Value, System.Globalization.CalendarWeekRule.FirstFullWeek, DayOfWeek.Monday);
    }
开发者ID:mvasilva,项目名称:SqlServerExtension,代码行数:8,代码来源:Util.cs


示例15: DayOfWeek

 public static SqlInt32 DayOfWeek(SqlDateTime time) {
     if (time.IsNull) return SqlInt32.Null;
     var numb = (int) time.Value.DayOfWeek;
     if(numb==0) {
         numb = 7;
     }
     return numb;
 }
开发者ID:Qorpent,项目名称:comdiv.oldcore,代码行数:8,代码来源:DateFunctions.cs


示例16: YearMonth

    public static SqlDateTime YearMonth(SqlDateTime dt)
    {
        if (dt.IsNull)
               return new SqlDateTime();

          System.DateTime moment = dt.Value.ToLocalTime();
          return new SqlDateTime(moment.Year, moment.Month, 1); //.ToString("yyyy-M"));
    }
开发者ID:weavver,项目名称:data,代码行数:8,代码来源:Common.cs


示例17: SqlPersistenceWorkflowInstanceDescription

 internal SqlPersistenceWorkflowInstanceDescription(Guid workflowInstanceId, WorkflowStatus status, bool isBlocked, string suspendOrTerminateDescription, SqlDateTime nextTimerExpiration)
 {
     this.workflowInstanceId = workflowInstanceId;
     this.status = status;
     this.isBlocked = isBlocked;
     this.suspendOrTerminateDescription = suspendOrTerminateDescription;
     this.nextTimerExpiration = nextTimerExpiration;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:8,代码来源:SqlPersistenceWorkflowInstanceDescription.cs


示例18: FillRow

 public static void FillRow(Object obj, out SqlDateTime timeWritten, out SqlChars message, out SqlChars category, out long instanceId)
 {
     EventLogEntry eventLogEntry = (EventLogEntry)obj;
     timeWritten = new SqlDateTime(eventLogEntry.TimeWritten);
     message = new SqlChars(eventLogEntry.Message);
     category = new SqlChars(eventLogEntry.Category);
     instanceId = eventLogEntry.InstanceId;
 }
开发者ID:jshield,项目名称:sqlperms,代码行数:8,代码来源:ClrTableFunction.cs


示例19: ConvertFromUTC

    public static SqlDateTime ConvertFromUTC(SqlDateTime SourceDateTime, SqlString DestinationTimeZone)
    {
        if (SourceDateTime.IsNull)
          return SqlDateTime.Null;

        Zone  tzDestination = Database.GetZone(DestinationTimeZone.Value);

        return tzDestination.ConvertToLocal(SourceDateTime.Value);
    }
开发者ID:APouchkov,项目名称:ExtendedStoredProcedures,代码行数:9,代码来源:Functions.cs


示例20: ConvertToUTC

    public static SqlDateTime ConvertToUTC(SqlDateTime SourceDateTime, SqlString SourceTimeZone)
    {
        if (SourceDateTime.IsNull)
          return SqlDateTime.Null;

        Zone  tzSource      = Database.GetZone(SourceTimeZone.Value);

        return tzSource.ConvertToUtc(SourceDateTime.Value);
    }
开发者ID:APouchkov,项目名称:ExtendedStoredProcedures,代码行数:9,代码来源:Functions.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# SqlTypes.SqlDecimal类代码示例发布时间:2022-05-26
下一篇:
C# SqlTypes.SqlChars类代码示例发布时间: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