Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CreateParameterForValue()

string System.Data.Common.DbCommandBuilder.CreateParameterForValue ( DbCommand command,
string parameterName,
string sourceColumn,
DataRowVersion version,
int parameterCount,
object value,
DbSchemaRow row,
StatementType statementType,
bool whereClause )
inlineprivate

Definition at line 922 of file DbCommandBuilder.cs.

923 {
924 DbParameter nextParameter = GetNextParameter(command, parameterCount);
925 if (parameterName == null)
926 {
927 nextParameter.ParameterName = GetParameterName(1 + parameterCount);
928 }
929 else
930 {
931 nextParameter.ParameterName = parameterName;
932 }
933 nextParameter.Direction = ParameterDirection.Input;
934 nextParameter.SourceColumn = sourceColumn;
935 nextParameter.SourceVersion = version;
936 nextParameter.SourceColumnNullMapping = false;
937 nextParameter.Value = value;
938 nextParameter.Size = 0;
939 ApplyParameterInfo(nextParameter, row.DataRow, statementType, whereClause);
940 if (!command.Parameters.Contains(nextParameter))
941 {
942 command.Parameters.Add(nextParameter);
943 }
944 if (parameterName == null)
945 {
946 return GetParameterPlaceholder(1 + parameterCount);
947 }
948 return string.Format(CultureInfo.InvariantCulture, _parameterMarkerFormat, parameterName);
949 }
string GetParameterPlaceholder(int parameterOrdinal)
void ApplyParameterInfo(DbParameter parameter, DataRow row, StatementType statementType, bool whereClause)
static DbParameter GetNextParameter(DbCommand command, int pcount)
string GetParameterName(int parameterOrdinal)
static CultureInfo InvariantCulture

References System.Data.Common.DbCommandBuilder._parameterMarkerFormat, System.Data.Common.DbParameterCollection.Add(), System.Data.Common.DbCommandBuilder.ApplyParameterInfo(), System.Data.Common.DbParameterCollection.Contains(), System.Data.Common.DbSchemaRow.DataRow, System.Data.Common.DbCommandBuilder.GetNextParameter(), System.Data.Common.DbCommandBuilder.GetParameterName(), System.Data.Common.DbCommandBuilder.GetParameterPlaceholder(), System.Globalization.CultureInfo.InvariantCulture, System.Data.Common.DbCommand.Parameters, and System.value.

Referenced by System.Data.Common.DbCommandBuilder.BuildInsertCommand(), System.Data.Common.DbCommandBuilder.BuildUpdateCommand(), and System.Data.Common.DbCommandBuilder.BuildWhereClause().