private void validateResultSetNumber(SqlInt32 resultsetNo) { if (resultsetNo < 0 || resultsetNo.IsNull) { throw new InvalidResultSetException("ResultSet index begins at 1. ResultSet index [" + resultsetNo.ToString() + "] is invalid."); } }
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."); } }
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); }
public static SqlBoolean SaveToFolderByZoomXY(SqlBinary image, SqlString rootFolderPath, SqlInt32 Zoom, SqlInt32 X, SqlInt32 Y) { SqlBoolean result = false; using (MemoryStream ms = new MemoryStream()) { ms.Write(image.Value, 0, image.Length); SetBeginPosition(ms); using (Icon2TileRendering bitmap = new Icon2TileRendering(ms)) { bitmap.SaveToPngFile((string)rootFolderPath, Zoom.ToString(), X.ToString(), Y.ToString()); result = true; } } // Put your code here return result; }
public static SqlString CollectNucsFromNeighborhoodOfRefSeqPos(SqlInt32 pupID, SqlInt64 pos, SqlInt32 posRadius) { using (SqlConnection conn = new SqlConnection("context connection=true")) { string beginOfSelection = "SELECT refNuc FROM [dbo].[coverageEnc]" + "WHERE [pupID] = " + pupID.ToString(); conn.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; long centerRefPos = pos.Value; int radius = posRadius.Value; string posList = ""; for (long i = centerRefPos - radius; i <= centerRefPos + radius; i++) { posList += i.ToString() + ","; } // The last comma is ignored: posList = posList.Substring(0, posList.Length - 1); long actualRefPos = pos.Value - posRadius.Value; cmd.CommandText = beginOfSelection + "AND [pos] in (" + posList + ")"; string result = ""; using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { string actualRefNuc = reader.GetString(0); result += actualRefNuc; } } if (result.Length != 2 * posRadius + 1) { result = HandleMissingPos(conn, beginOfSelection, centerRefPos, radius, result); } return new SqlString(result); } }
/// <summary> /// Converts the value of the specified SqlInt32 to its equivalent String representation. /// </summary> /// <param name="value">An SqlInt32.</param> /// <returns>The String equivalent of the SqlInt32.</returns> public static String ToString(SqlInt32 value) { return value.ToString(); }
/// <summary>Converts the value from <c>SqlInt32</c> to an equivalent <c>String</c> value.</summary> public static String ToString(SqlInt32 p) { return p.ToString(); }