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


C# SqlTypes.SqlInt32类代码示例

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


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

示例1: GetImageBound

    public static SqlGeometry GetImageBound(SqlDouble Longitude, SqlDouble Latitude, SqlInt32 Width, SqlInt32 Height,
        SqlDouble Zoom, SqlInt32 PixelYOffset)
    {
        long cpX, cpY, LeftTopX, LeftTopY, RightBottomX, RightBottomY;
        long halfWidth = ((long) Width) >> 1;
        long halfHeight = ((long) Height) >> 1;
        double dZoom = (double) Zoom;
        // получить центральный пиксел по коорд
        cpX = (long) FromLongitudeToXPixel(Longitude, Zoom);
        cpY = (long) (FromLatitudeToYPixel(Latitude, Zoom) + PixelYOffset);
        LeftTopX = cpX - halfWidth;
        LeftTopY = cpY - halfHeight;
        RightBottomX = cpX + halfWidth;
        RightBottomY = cpY + halfHeight;
        double Lat1, Lon1, Lat2, Lon2;
        Lat1 = FromYPixelToLat(LeftTopY, dZoom);
        Lon1 = FromXPixelToLon(LeftTopX, dZoom);
        Lat2 = FromYPixelToLat(RightBottomY, dZoom);
        Lon2 = FromXPixelToLon(RightBottomX, dZoom);

        //
        var geomBuilder = new SqlGeometryBuilder();
        geomBuilder.SetSrid((0));
        geomBuilder.BeginGeometry(OpenGisGeometryType.Polygon);
        geomBuilder.BeginFigure(Lon1, Lat1);
        geomBuilder.AddLine(Lon1, Lat2);
        geomBuilder.AddLine(Lon2, Lat2);
        geomBuilder.AddLine(Lon2, Lat1);
        geomBuilder.AddLine(Lon1, Lat1);
        geomBuilder.EndFigure();
        geomBuilder.EndGeometry();
        return geomBuilder.ConstructedGeometry;
    }
开发者ID:MoonDav,项目名称:TileRendering,代码行数:33,代码来源:SqlCoordsTileConversion.cs

示例2: FillMatchRow

 public static void FillMatchRow( object data,
    out SqlInt32 index, out SqlChars text )
 {
     MatchNode node = (MatchNode)data;
       index = new SqlInt32( node.Index );
       text = new SqlChars( node.Value.ToCharArray( ) );
 }
开发者ID:remifrazier,项目名称:SPCClogin_Public,代码行数:7,代码来源:RegexMatches.cs

示例3: MergePHkeys

 public static SqlBinary MergePHkeys(SqlBinary oldPHkeys, SqlInt16 newSnap, SqlInt32 newPHkey)
 {
     SqlIntArray keyArray = new SqlIntArray(oldPHkeys);
     int[] keys = keyArray.ToArray();
     keys[(short) newSnap] = (int) newPHkey;
     return SqlIntArray.FromArray(keys).ToSqlBuffer();
 }
开发者ID:dcrankshaw,项目名称:GadgetLoader,代码行数:7,代码来源:MergeReverseIndex.cs

示例4: SqlSucker_GetConInfo

    public static void SqlSucker_GetConInfo(SqlInt32 magic)
    {
        if (conInfoMagic != magic.Value) {
            throw new System.Exception(
                "This procedure is internal to SqlSucker. "
                + "Do not call it directly.");
        }

        lock (conInfoLock) {
            conInfoOk = false;

            using (SqlConnection ctxCon = new SqlConnection(
                "context connection=true"))
            using (SqlCommand ctxConCmd = new SqlCommand(
                "SELECT server, username, password, tablename, dbname "
                + "FROM SqlSuckerConfig", ctxCon)) {

                ctxCon.Open();

                using (SqlDataReader reader = ctxConCmd.ExecuteReader()) {
                    if (!reader.Read()) {
                        throw new System.Exception(
                            "No rows in SqlSuckerConfig");
                    }

                    tempServer = reader.GetString(0);
                    tempUser = reader.GetString(1);
                    tempPassword = reader.GetString(2);
                    tempTable = reader.GetString(3);
                    tempDatabase = reader.GetString(4);
                    conInfoOk = true;
                }
            }
        }
    }
开发者ID:apenwarr,项目名称:versaplex,代码行数:35,代码来源:AssemblyInfo.cs

示例5: OrInt3

 public static SqlInt32 OrInt3(
     SqlInt32 value0,
     SqlInt32 value1,
     SqlInt32 value2)
 {
     return OrSqlInt32(value0, value1, value2);
 }
开发者ID:raziqyork,项目名称:Geeks.SqlUtils,代码行数:7,代码来源:Or.SqlInt.cs

示例6: GetEventData

        public static IEnumerable GetEventData(SqlInt32 eventID)
        {
            const string query =
                "SELECT " +
                "    TimeDomainData, " +
                "    FrequencyDomainData " +
                "FROM EventData " +
                "WHERE ID = " +
                "(" +
                "    SELECT EventDataID " +
                "    FROM Event " +
                "    WHERE ID = @id " +
                ")";

            DataSet eventDataSet = new DataSet();

            using (SqlConnection connection = new SqlConnection("context connection=true"))
            using (SqlCommand command = new SqlCommand(query, connection))
            using (SqlDataAdapter adapter = new SqlDataAdapter(command))
            {
                connection.Open();
                command.Parameters.AddWithValue("@id", eventID);
                adapter.Fill(eventDataSet);
            }

            DataRow row = eventDataSet.Tables[0].Rows[0];

            return ReadFrom(Inflate((byte[])row["TimeDomainData"]))
                .Concat(ReadFrom(Inflate((byte[])row["FrequencyDomainData"]), freq: true))
                .ToArray();
        }
开发者ID:GridProtectionAlliance,项目名称:openXDA,代码行数:31,代码来源:XDAFunctions.cs

示例7: IsNucX

 public static SqlInt32 IsNucX(SqlInt64 posStart, SqlString misMNuc, SqlInt64 refPos, SqlString refNuc, SqlString countNuc)
 {
     SqlInt32 result;
     Dictionary<long, string> mutationPositions = new Dictionary<long, string>();
     string mutationPattern = @"[0-9]+ [ACGTN]+";
     MatchCollection matches = Regex.Matches(misMNuc.Value, mutationPattern);
     foreach (Match match in matches)
     {
         var foundMutation = match.Value;
         string[] foundMutParts = foundMutation.Split(' ');
         long mutStartPos = posStart.Value + Int32.Parse(foundMutParts[0]);
         var mutNuc = foundMutParts[1];
         mutationPositions.Add(mutStartPos, mutNuc);
     }
     string mutValue;
     if (mutationPositions.TryGetValue(refPos.Value, out mutValue))
     {
         result = new SqlInt32(countNuc.Value.Equals(mutValue) ? 1 : 0);
     }
     else
     {
         result = new SqlInt32(countNuc.Value.Equals(refNuc.Value) ? 1 : 0);
     }
     return result;
 }
开发者ID:szalaigj,项目名称:LoaderToolkit,代码行数:25,代码来源:IsNucX.cs

示例8: UpdateIPP

        public void UpdateIPP(SqlString nIPPId,SqlInt32 nPaymentId)
        {
            myRP.NNullIPPId = nIPPId;
            myRP.NPaymentID = nPaymentId;

            myRP.UpdateAllWnIPP_PaymentIDLogic();
        }
开发者ID:kimykunjun,项目名称:test,代码行数:7,代码来源:ReceiptPayment.cs

示例9: 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

示例10: TakeNotNull2

 public static SqlString TakeNotNull2(
     SqlInt32 index,
     SqlString text0,
     SqlString text1)
 {
     return TakeNotNull(index, text0, text1);
 }
开发者ID:raziqyork,项目名称:Geeks.SqlUtils,代码行数:7,代码来源:TakeNotNull.cs

示例11: validateResultSetNumber

 private void validateResultSetNumber(SqlInt32 resultsetNo)
 {
     if (resultsetNo < 0 || resultsetNo.IsNull)
     {
         throw new InvalidResultSetException("ResultSet index begins at 1. ResultSet index [" + resultsetNo.ToString() + "] is invalid.");
     }
 }
开发者ID:DFineNormal,项目名称:tSQLt,代码行数:7,代码来源:ResultSetFilter.cs

示例12: GetFileContents

        private static Byte[] GetFileContents(string table, SqlInt32 fileId, char format)
        {
            Byte[] bytes = null;

            using (var connection = new SqlConnection("context connection=true"))
            {
                connection.Open();

                string sql = "SELECT [Contents] FROM [dbo].[" + table + "] WHERE [FileId] = @fileId AND [Format] = @format";
                using (var command = new SqlCommand(sql, connection))
                {
                    command.Parameters.Add(new SqlParameter("@fileId", SqlDbType.Int) { Value = fileId });
                    command.Parameters.Add(new SqlParameter("@format", SqlDbType.Char) { Value = format });

                    using (SqlDataReader results = command.ExecuteReader())
                    {
                        while (results.Read())
                        {
                            bytes = results.GetSqlBytes(0).Buffer;
                        }
                    }
                }
            }
            return bytes;
        }
开发者ID:regan-sarwas,项目名称:AnimalMovement,代码行数:25,代码来源:TfpSummerizer.cs

示例13: GetSkyline

 public static void GetSkyline(SqlString strQuery, SqlString strOperators, SqlInt32 numberOfRecords, SqlInt32 sortType, SqlInt32 upToLevel)
 {
     SPMultipleSkylineBNLLevel skyline = new SPMultipleSkylineBNLLevel();
     string[] additionalParameters = new string[5];
     additionalParameters[4] = upToLevel.ToString();
     skyline.GetSkylineTable(strQuery.ToString(), strOperators.ToString(), numberOfRecords.Value, false, Helper.CnnStringSqlclr, Helper.ProviderClr, additionalParameters, sortType.Value, true);
 }
开发者ID:Bulld0zzer,项目名称:prefSQL,代码行数:7,代码来源:SPMultipleSkylineBNLLevel.cs

示例14: sendSelectedResultSetToSqlContext

        public void sendSelectedResultSetToSqlContext(SqlInt32 resultsetNo, SqlString command)
        {
            validateResultSetNumber(resultsetNo);

            SqlDataReader dataReader = testDatabaseFacade.executeCommand(command);

            int ResultsetCount = 0;
            if (dataReader.FieldCount > 0)
            {
                do
                {
                    ResultsetCount++;
                    if (ResultsetCount == resultsetNo)
                    {
                        sendResultsetRecords(dataReader);
                        break;
                    }
                } while (dataReader.NextResult());
            }
            dataReader.Close();

            if(ResultsetCount < resultsetNo)
            {
                throw new InvalidResultSetException("Execution returned only " + ResultsetCount.ToString() + " ResultSets. ResultSet [" + resultsetNo.ToString() + "] does not exist.");
            }
        }
开发者ID:DFineNormal,项目名称:tSQLt,代码行数:26,代码来源:ResultSetFilter.cs

示例15: ChangeContainerPublicAccessMethod

        public static void ChangeContainerPublicAccessMethod(
            SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
            SqlString containerName,
            SqlString containerPublicReadAccess,            
            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);

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


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