Click here to Skip to main content
15,914,395 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: get date format Pin
Dave Kreskowiak16-Jun-07 12:01
mveDave Kreskowiak16-Jun-07 12:01 
QuestionRadiobutton inside gridview Pin
sgkani15-Jun-07 21:38
sgkani15-Jun-07 21:38 
AnswerRe: Radiobutton inside gridview Pin
Duane in Japan17-Jun-07 0:22
Duane in Japan17-Jun-07 0:22 
QuestionHow to perform direct edit,add ,update and delete operations on datagridview in vb.net. Pin
hbk_leo15-Jun-07 20:20
hbk_leo15-Jun-07 20:20 
GeneralRe: How to perform direct edit,add ,update and delete operations on datagridview in vb.net. Pin
venu_dil16-Jun-07 0:08
venu_dil16-Jun-07 0:08 
GeneralRe: How to perform direct edit,add ,update and delete operations on datagridview in vb.net. Pin
hbk_leo16-Jun-07 21:02
hbk_leo16-Jun-07 21:02 
QuestionProject Database Pin
'Drew15-Jun-07 12:04
'Drew15-Jun-07 12:04 
QuestionInserting new records in a child table Pin
Psyfo15-Jun-07 11:31
Psyfo15-Jun-07 11:31 
Hi everyone

I have the folowing code in the Business class in my program, but when i run it says that there's an error in the sql. Can you please help


Public Function AddSale(ByVal dtDate As DateTime, ByVal bookcode As String, ByVal InvoiceNo As String, ByVal qty As Integer, ByVal subtot As Single, ByVal vat As Single, ByVal tot As Single) As String
Dim sql As String
Dim cmd As OleDb.OleDbCommand
Dim result As String = ""
Try


sql = "INSERT INTO SALES (Dates, BookCode, InvoiceNumber, Quantity, SubTotal, VAT, Total) Values ( " + dtDate + " ,'" + bookcode + "','" + InvoiceNo + "', qty , subtot, vat, tot)"
cmd = New OleDb.OleDbCommand(sql, con)

cmd.Parameters.Add(New OleDb.OleDbParameter("@qty", qty))
cmd.Parameters.Add(New OleDb.OleDbParameter("@subtot", subtot))
cmd.Parameters.Add(New OleDb.OleDbParameter("@vat", vat))
cmd.Parameters.Add(New OleDb.OleDbParameter("@tot", tot))
cmd.Parameters.Add(New OleDb.OleDbParameter("@dtDate", dtDate))

If cmd.Connection.State = ConnectionState.Closed Then
cmd.Connection.Open()
End If
cmd.CommandText = sql
cmd.ExecuteNonQuery()
result = "true"

Catch ex As Exception
result = ex.Message.ToString()
End Try
Return result
End Function
AnswerRe: Inserting new records in a child table Pin
bigjokey15-Jun-07 12:10
bigjokey15-Jun-07 12:10 
QuestionVB.Net Custom ListView Row Height Pin
bigjokey15-Jun-07 10:38
bigjokey15-Jun-07 10:38 
AnswerRe: VB.Net Custom ListView Row Height Pin
Tarakeshwar Reddy15-Jun-07 10:54
professionalTarakeshwar Reddy15-Jun-07 10:54 
GeneralRe: VB.Net Custom ListView Row Height Pin
bigjokey15-Jun-07 11:13
bigjokey15-Jun-07 11:13 
QuestionExporting data of Datagrids to Excel in VB.NET Pin
hsprasain15-Jun-07 9:59
hsprasain15-Jun-07 9:59 
AnswerRe: Exporting data of Datagrids to Excel in VB.NET Pin
Taylor Kobani16-Jun-07 4:19
Taylor Kobani16-Jun-07 4:19 
GeneralRe: Exporting data of Datagrids to Excel in VB.NET Pin
hsprasain16-Jun-07 10:09
hsprasain16-Jun-07 10:09 
QuestionContextmenu not always showing on right clicking DataGrid Pin
GuyThiebaut15-Jun-07 9:17
professionalGuyThiebaut15-Jun-07 9:17 
AnswerRe: Contextmenu not always showing on right clicking DataGrid Pin
Taylor Kobani16-Jun-07 4:29
Taylor Kobani16-Jun-07 4:29 
GeneralRe: Contextmenu not always showing on right clicking DataGrid Pin
GuyThiebaut16-Jun-07 6:34
professionalGuyThiebaut16-Jun-07 6:34 
Questionusing recordset in MS Access to place values into array Pin
reegan4115-Jun-07 3:20
reegan4115-Jun-07 3:20 
AnswerRe: using recordset in MS Access to place values into array Pin
GoodID21-Jun-07 17:56
GoodID21-Jun-07 17:56 
Questioncan any one tell reular exp to validate domain name Pin
koolprasad200315-Jun-07 3:08
professionalkoolprasad200315-Jun-07 3:08 
AnswerRe: can any one tell reular exp to validate domain name Pin
Tom Wright15-Jun-07 3:53
Tom Wright15-Jun-07 3:53 
GeneralRe: can any one tell reular exp to validate domain name Pin
koolprasad200315-Jun-07 21:15
professionalkoolprasad200315-Jun-07 21:15 
AnswerRe: can any one tell reular exp to validate domain name Pin
berghain15-Jun-07 4:47
berghain15-Jun-07 4:47 
GeneralRe: can any one tell reular exp to validate domain name Pin
koolprasad200315-Jun-07 21:13
professionalkoolprasad200315-Jun-07 21:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.