Click here to Skip to main content
16,005,080 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Resolution Pin
Christian Graus3-May-08 16:49
protectorChristian Graus3-May-08 16:49 
Questiondetecting if screensaver is activated in VB 2005 Pin
GuildfordG3-May-08 2:55
GuildfordG3-May-08 2:55 
AnswerRe: detecting if screensaver is activated in VB 2005 Pin
jzonthemtn4-May-08 6:04
jzonthemtn4-May-08 6:04 
QuestionHow to bind two sql statement with commit in vb.net Pin
vb_buddy2-May-08 19:32
vb_buddy2-May-08 19:32 
AnswerRe: How to bind two sql statement with commit in vb.net Pin
Christian Graus2-May-08 21:15
protectorChristian Graus2-May-08 21:15 
GeneralRe: How to bind two sql statement with commit in vb.net Pin
vb_buddy4-May-08 7:12
vb_buddy4-May-08 7:12 
GeneralRe: How to bind two sql statement with commit in vb.net Pin
Dave Kreskowiak4-May-08 7:22
mveDave Kreskowiak4-May-08 7:22 
GeneralRe: How to bind two sql statement with commit in vb.net Pin
vb_buddy4-May-08 19:24
vb_buddy4-May-08 19:24 
Well, here is the code, I have also given the SQL field type.
Anyways, what are string concatenation. What is the difference between insert through string concatenation and parameterized queries. Can you please focus me that where am i going wrong.

con.Open()
trans = con.BeginTransaction()
Try
cmd = New SqlClient.SqlCommand("INSERT INTO issuec(cen, cses, ctdate, cttime, caction, camt, cde, cdch, crt, crr, cda, uc, cty) " & _
"VALUES('" & cen & "','" & frm.txtcses.Text.Trim & "','" & s_date & "','" & s_time & "','" & temp & "','" & a11 & "','" & sdepo & "','" & b & "','" & type & "','" & reason & "','" & damage & "'," & ccde & ",'" & cs & "')", con, trans)
cmd.ExecuteNonQuery()

cmd = New SqlClient.SqlCommand("update master set ccb='" & newbalance & "', cact='" & t & "',cldate='" & s_date & "', cl='" & lc & "', cde=" & cnt & ", cty='" & cs & "' where cen=" & cen & "", con, trans)
cmd.ExecuteNonQuery()

trans.Commit()
Catch ex As Exception
trans.Rollback()
End Try
con.Close()

Field type:
Sql1:
------
cen: numeric
cses: int
ctdate: datetime
cttime: char
caction : char
camt: numeric
cde : numeric
cdch : numeric
crt : char
crr : varchar
cda : char
uc : int
cty : char

Sql2:
------
ccb : numeric
cact : char
cldate : datetime
cl : cahr
cde : int
cty : char
cen : numeric

I have also given the field type for the above code in SQL.

Regards
GeneralRe: How to bind two sql statement with commit in vb.net Pin
Dave Kreskowiak5-May-08 0:50
mveDave Kreskowiak5-May-08 0:50 
AnswerRe: How to bind two sql statement with commit in vb.net Pin
Tim Carmichael3-May-08 3:11
Tim Carmichael3-May-08 3:11 
AnswerRe: How to bind two sql statement with commit in vb.net Pin
Guffa3-May-08 6:40
Guffa3-May-08 6:40 
QuestionDatabase Tutorials Pin
Zaegra2-May-08 7:48
Zaegra2-May-08 7:48 
AnswerRe: Database Tutorials Pin
Rob Graham2-May-08 8:00
Rob Graham2-May-08 8:00 
GeneralRe: Database Tutorials Pin
Zaegra2-May-08 8:14
Zaegra2-May-08 8:14 
GeneralRe: Database Tutorials Pin
Christian Graus2-May-08 12:48
protectorChristian Graus2-May-08 12:48 
GeneralRe: Database Tutorials Pin
Mycroft Holmes2-May-08 16:27
professionalMycroft Holmes2-May-08 16:27 
GeneralRe: Database Tutorials Pin
Rob Graham3-May-08 4:30
Rob Graham3-May-08 4:30 
QuestionRe: Database Tutorials Pin
Luc Pattyn3-May-08 5:42
sitebuilderLuc Pattyn3-May-08 5:42 
QuestionAnyway around overloaded operators? Pin
cstrader2322-May-08 4:45
cstrader2322-May-08 4:45 
AnswerRe: Anyway around overloaded operators? Pin
Dave Kreskowiak2-May-08 4:55
mveDave Kreskowiak2-May-08 4:55 
GeneralRe: Anyway around overloaded operators? Pin
cstrader2322-May-08 5:01
cstrader2322-May-08 5:01 
GeneralRe: Anyway around overloaded operators? Pin
Christian Graus2-May-08 12:50
protectorChristian Graus2-May-08 12:50 
GeneralRe: Anyway around overloaded operators? Pin
Dave Kreskowiak2-May-08 20:20
mveDave Kreskowiak2-May-08 20:20 
GeneralRe: Anyway around overloaded operators? Pin
Christian Graus2-May-08 20:40
protectorChristian Graus2-May-08 20:40 
GeneralRe: Anyway around overloaded operators? Pin
Guffa2-May-08 13:45
Guffa2-May-08 13:45 

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.