Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hi every body: why this code make an error: Incorrect syntax near '*'.
VB
Public Sub Delete_data()
        cn.Open()
        Dim rs As New SqlCommand("delete * from shakhes where tadieh_shakhes='" & TextBoxX2.Text & "'", cn)
        rs.ExecuteNonQuery()
        cn.Close()
        display_data()
    End Sub
Posted
Updated 15-Aug-15 16:45pm
v2
Comments
rezaeti 15-Aug-15 21:52pm    
please help!
rezaeti 15-Aug-15 21:53pm    
is there any one to help me!
[no name] 15-Aug-15 22:09pm    
You need to learn to have some patience.

1 solution

change
SQL
delete * from shakhes

to
SQL
delete  from shakhes 

delete syntax is
SQL
DELETE FROM table_name
WHERE some_column=some_value;
 
Share this answer
 
v2
Comments
rezaeti 15-Aug-15 22:02pm    
so math thanks
rezaeti 15-Aug-15 22:02pm    
it's solved
DamithSL 15-Aug-15 23:00pm    
you can accept this answer then, read how does accepting solution work in Code Project Quick Answers FAQ[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900