• Join/Login
  • Business Software
  • Open Source Software
  • For Vendors
  • Blog
  • About
  • More
    • Articles
    • Create
    • SourceForge Podcast
    • Site Documentation
    • Subscribe to our Newsletter
    • Support Request
SourceForge logo
For Vendors Help Create Join Login
SourceForge logo
SourceForge logo
Business Software
Open Source Software
SourceForge Podcast
Resources
  • Articles
  • Case Studies
  • Blog
Menu
  • Help
  • Create
  • Join
  • Login
  • Home
  • Browse
  • SharpCore Framework
  • Bugs

2 small bugs , SqlClientUtility class

Status: Beta
Brought to you by: aanttila
This project can now be found here.
  • Summary
  • Files
  • Reviews
  • Support
  • Bugs
  • News
  • Donate
Menu ▾ ▴
  • Create Ticket
  • View Stats

Group

Searches

  • Changes
  • Closed Tickets
  • Open Tickets

Help

  • Formatting Help

#1 2 small bugs , SqlClientUtility class

open
nobody
None
5
2007-12-05
2007-12-05
Anonymous
No

1- There is an error in SqlClientUtility at line 304
//command.Parameters[i].Value = CheckValue(values[i]);
must be replaced by
command.Parameters.Add(CheckValue(values[i]));

2- There is no GetInt16 method in SqlClientUtility calss.

it could be useful :

/// <summary>
/// Attempts to extract the requested column value from a DataRow.
/// </summary>
/// <param name="dataRow">The DataRow to extract the column value from.</param>
/// <param name="columnName">The name of the column to extract the value from.</param>
/// <param name="valueIfNull">The value to return if the requested column value is null or DBNull.Value.</param>
/// <returns>The value contained in the requested column if the value is not null or DBNull.Value, otherwise null.</returns>
public static short GetInt16(DataRow dataRow, string columnName, short valueIfNull)
{
object value = GetObject(dataRow, columnName, null);
if (value != null)
{
if (value is short)
{
return (short) value;
}
else
{
return Int16.Parse(value.ToString());
}
}
else
{
return valueIfNull;
}
}

    /// &lt;summary&gt;
    /// Attempts to extract the requested column value from a SqlDataReader.
    /// &lt;/summary&gt;
    /// &lt;param name="dataReader"&gt;The SqlDataReader to extract the column value from.&lt;/param&gt;
    /// &lt;param name="columnName"&gt;The name of the column to extract the value from.&lt;/param&gt;
    /// &lt;param name="valueIfNull"&gt;The value to return if the requested column value is null or DBNull.Value.&lt;/param&gt;
    /// &lt;returns&gt;The value contained in the requested column if the value is not null or DBNull.Value, otherwise null.&lt;/returns&gt;
    public static short GetInt16\(SqlDataReader dataReader, string columnName, short valueIfNull\)
    \{
        object value = GetObject\(dataReader, columnName, null\);
        if \(value \!= null\)
        \{

if (value is short)
{
return (short)value;
}
else
{
return Int16.Parse(value.ToString());
}
}
else
{
return valueIfNull;
}
}

Discussion

  • Nobody/Anonymous

    Nobody/Anonymous - 2007-12-05
     
    SqlClientUtility.cs
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

Log in to post a comment.

SourceForge
  • Create a Project
  • Open Source Software
  • Business Software
  • Top Downloaded Projects
Company
  • About
  • Team
  • SourceForge Headquarters
    225 Broadway Suite 1600
    San Diego, CA 92101
    +1 (858) 422-6466
Resources
  • Support
  • Site Documentation
  • Site Status
  • SourceForge Reviews
SourceForge logo
© 2025 Slashdot Media. All Rights Reserved.
Terms Privacy Opt Out Advertise
×
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.