Hi,
I am quite new to DOT NET environment.
I use develop MS Access dbs for small shops and establishments. I could say I got success in vba codings in a smooth way.
I recently turned towards DOT NET environment. My net framework ver is 3.5and I installled sql server 2005 & Studio 2008 on my laptop.
I started developing a small db for a shop that contains 2-3 forms. I wrote codelines to add & modify record successfully.
I have 2 questions here.
1.
I am trying to write code to DELETE record after calling on form thru a combo with below simple code but produces error.
Private Sub CmdDelSupp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdDelSupp.Click
conn.Execute("Delete * from T_ProductMaster where ProdCode = '" & Val(TxtProdCode.Text) & "' and ProdName='" & Val(TxtProdName.Text) & "'")
End Sub
The error display at conn line is: COMexception was unhandled
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '*'.
Whats wrong here.
2.
I want to transfer control from one text box to another (next in tab order) thru by pressing ENTER key and not by Tab key which is bydefault
I know in VB I use to write KEYCODE=13 then..... but dot net is diff than what I learned in VBA of Access and Visual Basic.
Please extend your help.
With kind regards,
Ashfaque
I am quite new to DOT NET environment.
I use develop MS Access dbs for small shops and establishments. I could say I got success in vba codings in a smooth way.
I recently turned towards DOT NET environment. My net framework ver is 3.5and I installled sql server 2005 & Studio 2008 on my laptop.
I started developing a small db for a shop that contains 2-3 forms. I wrote codelines to add & modify record successfully.
I have 2 questions here.
1.
I am trying to write code to DELETE record after calling on form thru a combo with below simple code but produces error.
Private Sub CmdDelSupp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdDelSupp.Click
conn.Execute("Delete * from T_ProductMaster where ProdCode = '" & Val(TxtProdCode.Text) & "' and ProdName='" & Val(TxtProdName.Text) & "'")
End Sub
The error display at conn line is: COMexception was unhandled
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '*'.
Whats wrong here.
2.
I want to transfer control from one text box to another (next in tab order) thru by pressing ENTER key and not by Tab key which is bydefault
I know in VB I use to write KEYCODE=13 then..... but dot net is diff than what I learned in VBA of Access and Visual Basic.
Please extend your help.
With kind regards,
Ashfaque