rHasan
Active member
- Joined
- Jan 10, 2007
- Messages
- 43
- Programming Experience
- 3-5
I've provided the Delete functionality in my form in this way -
This system works, but is it all right to use? Does it have any drawback ?
Thnx!
VB.NET:
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Not[/COLOR][/SIZE][SIZE=2] IsConnectionOpen() [/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE]
[SIZE=2]OpenConnection()[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE]
[SIZE=2]objCommand = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDbCommand([/SIZE][SIZE=2][COLOR=#a31515]"Delete From Color[/COLOR][/SIZE][SIZE=2][COLOR=#a31515] Where Color[/COLOR][/SIZE][SIZE=2][COLOR=#a31515]ID = "[/COLOR][/SIZE][SIZE=2] & Val(txtID.Text), objConnection)[/SIZE]
[SIZE=2]objCommand.ExecuteNonQuery()[/SIZE]
[SIZE=2]ShowData()[/SIZE]
[SIZE=2]CloseConnection()[/SIZE]
Thnx!