UPDATE [英] UPDATE
问题描述
Bom dia!
Tenho um problema em um UPDATE,em um sistema que criei,funciona normal,porémemoutro da o seguinte erro
System.Data.dll中出现未处理的"System.Data.OleDb.OleDbException"类型异常
附加信息:UPDATE语句中的语法错误。
segue a minha rotina:
      'faz a conexao com o banco de dados de clientes
     使用conexaoaluno As OleDbConnection = getconnectionaluno()
          conexaoaluno.Open()
          'salva os dados no banco de alunos
          Dim aluno As New OleDb.OleDbCommand
          aluno.CommandText =" update tbalunos set nome ='" &安培; txtnome.Text& "',其中nome ='" &安培; cbxaluno.Text& "'"
$
          aluno.CommandType = CommandType.Text
          aluno.Connection = conexaoaluno
          Dim carregadados As Integer
          carregadados = aluno.ExecuteNonQuery
          conexaoaluno.Close()
     结束使用
来自gentileza,preciso de uma ajuda。
< span style =""> 您好,
那里在WHERE之前是一个错误的逗号。
我还会使用参数,例如
使用上述语法是您的选择,但是",","逗号需要去。
Bom dia!
Tenho um problema em um UPDATE, em um sistema que criei, funciona normal, porém em outro da o seguinte erro
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll
Additional information: Syntax error in UPDATE statement.
segue a minha rotina:
'faz a conexao com o banco de dados de clientes
Using conexaoaluno As OleDbConnection = getconnectionaluno()
conexaoaluno.Open()
'salva os dados no banco de alunos
Dim aluno As New OleDb.OleDbCommand
aluno.CommandText = "update tbalunos set nome = '" & txtnome.Text & "', where nome = '" & cbxaluno.Text & "' "
aluno.CommandType = CommandType.Text
aluno.Connection = conexaoaluno
Dim carregadados As Integer
carregadados = aluno.ExecuteNonQuery
conexaoaluno.Close()
End Using
Por gentileza, preciso de uma ajuda.
Hello,
There is an erroneous comma before the WHERE. Also I would use parameters eg
Using the above syntax is your choice but the "," comma needs to go.
这篇关于UPDATE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!