OleDbCommandBuilder.GetUpdateCommand Método
Definição
Obtém o objeto OleDbCommand gerado automaticamente necessário para realizar atualizações na fonte de dados.Gets the automatically generated OleDbCommand object required to perform updates at the data source.
Sobrecargas
| GetUpdateCommand() |
Obtém o objeto OleDbCommand gerado automaticamente necessário para realizar atualizações na fonte de dados.Gets the automatically generated OleDbCommand object required to perform updates at the data source. |
| GetUpdateCommand(Boolean) |
Obtém o objeto OleDbCommand gerado automaticamente necessário para realizar atualizações na fonte de dados, opcionalmente usando colunas para nomes de parâmetros.Gets the automatically generated OleDbCommand object required to perform updates at the data source, optionally using columns for parameter names. |
Comentários
Um aplicativo pode usar o GetUpdateCommand método para fins informativos ou de solução de problemas, pois retorna o OleDbCommand objeto a ser executado.An application can use the GetUpdateCommand method for informational or troubleshooting purposes because it returns the OleDbCommand object to be executed.
Você também pode usar GetUpdateCommand como a base de um comando modificado.You can also use GetUpdateCommand as the basis of a modified command. Por exemplo, você pode chamar GetUpdateCommand e modificar o CommandTimeout valor e, em seguida, defini-lo explicitamente no OleDbDataAdapter .For example, you might call GetUpdateCommand and modify the CommandTimeout value, and then explicitly set that on the OleDbDataAdapter.
Depois que a instrução SQL é gerada pela primeira vez, o aplicativo deve chamar explicitamente RefreshSchema se ele altera a instrução de qualquer forma.After the SQL statement is first generated, the application must explicitly call RefreshSchema if it changes the statement in any way. Caso contrário, o GetUpdateCommand ainda estará usando informações da instrução anterior, que podem não estar corretas.Otherwise, the GetUpdateCommand will be still be using information from the previous statement, which might not be correct. As instruções SQL são geradas pela primeira vez quando o aplicativo chama o UpdateCommand ou o GetUpdateCommand .The SQL statements are first generated when the application calls either UpdateCommand or GetUpdateCommand.
GetUpdateCommand()
Obtém o objeto OleDbCommand gerado automaticamente necessário para realizar atualizações na fonte de dados.Gets the automatically generated OleDbCommand object required to perform updates at the data source.
public:
System::Data::OleDb::OleDbCommand ^ GetUpdateCommand();
public System.Data.OleDb.OleDbCommand GetUpdateCommand ();
override this.GetUpdateCommand : unit -> System.Data.OleDb.OleDbCommand
member this.GetUpdateCommand : unit -> System.Data.OleDb.OleDbCommand
Public Function GetUpdateCommand () As OleDbCommand
Retornos
O objeto OleDbCommand gerado automaticamente necessário para executar atualizações.The automatically generated OleDbCommand object required to perform updates.
Comentários
Um aplicativo pode usar o GetUpdateCommand método para fins informativos ou de solução de problemas, pois retorna o OleDbCommand objeto a ser executado.An application can use the GetUpdateCommand method for informational or troubleshooting purposes because it returns the OleDbCommand object to be executed.
Você também pode usar GetUpdateCommand como a base de um comando modificado.You can also use GetUpdateCommand as the basis of a modified command. Por exemplo, você pode chamar GetUpdateCommand e modificar o CommandTimeout valor e, em seguida, defini-lo explicitamente no OleDbDataAdapter .For example, you might call GetUpdateCommand and modify the CommandTimeout value, and then explicitly set that on the OleDbDataAdapter.
Depois que a instrução SQL é gerada pela primeira vez, o aplicativo deve chamar explicitamente RefreshSchema se ele altera a instrução de qualquer forma.After the SQL statement is first generated, the application must explicitly call RefreshSchema if it changes the statement in any way. Caso contrário, o GetUpdateCommand ainda estará usando informações da instrução anterior, que podem não estar corretas.Otherwise, the GetUpdateCommand will be still be using information from the previous statement, which might not be correct. As instruções SQL são geradas pela primeira vez quando o aplicativo chama o UpdateCommand ou o GetUpdateCommand .The SQL statements are first generated when the application calls either UpdateCommand or GetUpdateCommand.
Aplica-se a
GetUpdateCommand(Boolean)
Obtém o objeto OleDbCommand gerado automaticamente necessário para realizar atualizações na fonte de dados, opcionalmente usando colunas para nomes de parâmetros.Gets the automatically generated OleDbCommand object required to perform updates at the data source, optionally using columns for parameter names.
public:
System::Data::OleDb::OleDbCommand ^ GetUpdateCommand(bool useColumnsForParameterNames);
public System.Data.OleDb.OleDbCommand GetUpdateCommand (bool useColumnsForParameterNames);
override this.GetUpdateCommand : bool -> System.Data.OleDb.OleDbCommand
Public Function GetUpdateCommand (useColumnsForParameterNames As Boolean) As OleDbCommand
Parâmetros
- useColumnsForParameterNames
- Boolean
Se true, gerar nomes de parâmetro correspondentes a nomes de coluna, se for possível.If true, generate parameter names matching column names, if it is possible. Se false, gerar @p1, @p2 e assim por diante.If false, generate @p1, @p2, and so on.
Retornos
O objeto OleDbCommand gerado automaticamente necessário para executar atualizações.The automatically generated OleDbCommand object required to perform updates.
Comentários
Um aplicativo pode usar o GetUpdateCommand método para fins informativos ou de solução de problemas, pois retorna o OleDbCommand objeto a ser executado.An application can use the GetUpdateCommand method for informational or troubleshooting purposes because it returns the OleDbCommand object to be executed.
Você também pode usar GetUpdateCommand como a base de um comando modificado.You can also use GetUpdateCommand as the basis of a modified command. Por exemplo, você pode chamar GetUpdateCommand e modificar o CommandTimeout valor e, em seguida, defini-lo explicitamente no OleDbDataAdapter .For example, you might call GetUpdateCommand and modify the CommandTimeout value, and then explicitly set that on the OleDbDataAdapter.
Depois que a instrução SQL é gerada pela primeira vez, o aplicativo deve chamar explicitamente RefreshSchema se ele altera a instrução de qualquer forma.After the SQL statement is first generated, the application must explicitly call RefreshSchema if it changes the statement in any way. Caso contrário, o GetUpdateCommand ainda estará usando informações da instrução anterior, que podem não estar corretas.Otherwise, the GetUpdateCommand will be still be using information from the previous statement, which might not be correct. As instruções SQL são geradas pela primeira vez quando o aplicativo chama o UpdateCommand ou o GetUpdateCommand .The SQL statements are first generated when the application calls either UpdateCommand or GetUpdateCommand.
O comportamento padrão, ao gerar nomes de parâmetro, é usar @p1 , @p2 e assim por diante para os vários parâmetros.The default behavior, when generating parameter names, is to use @p1, @p2, and so on for the various parameters. trueA passagem do useColumnsForParameterNames parâmetro permite forçar o OleDbCommandBuilder a gerar parâmetros com base nos nomes de coluna.Passing true for the useColumnsForParameterNames parameter lets you force the OleDbCommandBuilder to generate parameters based on the column names instead. Isso só terá sucesso se as seguintes condições forem atendidas:This succeeds only if the following conditions are met:
O ParameterNameMaxLength foi especificado e seu comprimento é igual ou maior que o nome de parâmetro gerado.The ParameterNameMaxLength has been specified and its length is equal to or greater than the generated parameter name.
O nome de parâmetro gerado atende aos critérios especificados na ParameterNamePattern expressão regular.The generated parameter name meets the criteria specified in the ParameterNamePattern regular expression.
Um ParameterMarkerFormat é especificado.A ParameterMarkerFormat is specified.