This commit is contained in:
@@ -537,16 +537,8 @@ Aguinaldoapagar
|
||||
if (Listaparametros!= null)
|
||||
{
|
||||
foreach (parametroQuery pr in Listaparametros)
|
||||
{
|
||||
if (pr.SqlDataType != null)
|
||||
{
|
||||
if (pr.ParameterDirection != null)
|
||||
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
|
||||
else
|
||||
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = pr.SqlValue != null ? pr.SqlValue : DBNull.Value;
|
||||
}
|
||||
else
|
||||
SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue);
|
||||
{
|
||||
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -586,15 +578,7 @@ Aguinaldoapagar
|
||||
{
|
||||
foreach (parametroQuery pr in Listaparametros)
|
||||
{
|
||||
if ( pr.SqlDataType != null)
|
||||
{
|
||||
if ( pr.ParameterDirection != null)
|
||||
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
|
||||
else
|
||||
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = pr.SqlValue != null ? pr.SqlValue : DBNull.Value;
|
||||
}
|
||||
else
|
||||
SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue);
|
||||
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -714,18 +698,18 @@ Aguinaldoapagar
|
||||
}
|
||||
}
|
||||
|
||||
public class parametroQuery
|
||||
{
|
||||
public parametroQuery(string parameterName, object sqlValue, SqlDbType sqlDataType = default(SqlDbType), ParameterDirection parameterDirection = default(ParameterDirection))
|
||||
{
|
||||
this.ParameterName = parameterName;
|
||||
this.SqlDataType = sqlDataType;
|
||||
this.ParameterDirection = parameterDirection;
|
||||
this.SqlValue = sqlValue;
|
||||
}
|
||||
//public class parametroQuery
|
||||
//{
|
||||
// public parametroQuery(string parameterName, object sqlValue, SqlDbType sqlDataType = default(SqlDbType), ParameterDirection parameterDirection = default(ParameterDirection))
|
||||
// {
|
||||
// this.ParameterName = parameterName;
|
||||
// this.SqlDataType = sqlDataType;
|
||||
// this.ParameterDirection = parameterDirection;
|
||||
// this.SqlValue = sqlValue;
|
||||
// }
|
||||
|
||||
public string ParameterName { get; set; }
|
||||
public SqlDbType SqlDataType { get; set; }
|
||||
public ParameterDirection ParameterDirection { get; set; }
|
||||
public object SqlValue { get; set; }
|
||||
}
|
||||
// public string ParameterName { get; set; }
|
||||
// public SqlDbType SqlDataType { get; set; }
|
||||
// public ParameterDirection ParameterDirection { get; set; }
|
||||
// public object SqlValue { get; set; }
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user