Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    vb.net 05 SQL Query Error Exception

    Ciao a tutti ho un problema con una query delete...

    mi dà errore sul commandtext dicendomi che c'è un errore sulla stringa query in prossimità di "*"

    può essere qualcosa nella tbl che non va bene?
    ciao e grazie


    Codice PHP:
    Public Function DeleteUser(ByVal id As Integer) As Boolean

            Dim command 
    As SqlCommand
            Dim nRecord 
    As Integer

            
    If id 0 Then Return True

            command 
    = New SqlCommand() 'SqlCommand()
            command.Connection = cnn
           [B] command.CommandText = "DELETE * FROM Utente WHERE User_id = '" & id & "' "[/B] 
            command.CommandType = CommandType.Text
            '
    Esegue la Query
            cnn
    .Open()
            
    nRecord command.ExecuteNonQuery()
            
    cnn.Close()
            If 
    nRecord 0 Then Return True
            
    Return False


        End 
    Function 

  2. #2
    Prova così...
    command.CommandText = "DELETE FROM Utente WHERE User_id = '" & id & "' "

    mic

  3. #3
    grazie...
    avevo risolto... non andava appunto l' * nel DELETE,
    errore del mio collega che mi ha passato la query
    grazie cmq


Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.