Click here to Skip to main content
15,884,298 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionVBScript DeleteFolder method cannot delete folders under System32 on Win 8.1 Pin
robwm121-Apr-16 10:36
robwm121-Apr-16 10:36 
AnswerRe: VBScript DeleteFolder method cannot delete folders under System32 on Win 8.1 Pin
Dave Kreskowiak21-Apr-16 14:31
mveDave Kreskowiak21-Apr-16 14:31 
AnswerRe: VBScript DeleteFolder method cannot delete folders under System32 on Win 8.1 Pin
Sonhospa25-Apr-16 0:59
Sonhospa25-Apr-16 0:59 
QuestionHow can i make the official VB.net TCP async Example work ?! Pin
Ghassan Mohamed Yousif20-Apr-16 23:53
Ghassan Mohamed Yousif20-Apr-16 23:53 
AnswerRe: How can i make the official VB.net TCP async Example work ?! Pin
Dave Kreskowiak21-Apr-16 2:09
mveDave Kreskowiak21-Apr-16 2:09 
GeneralRe: How can i make the official VB.net TCP async Example work ?! Pin
Ghassan Mohamed Yousif22-Apr-16 9:45
Ghassan Mohamed Yousif22-Apr-16 9:45 
GeneralRe: How can i make the official VB.net TCP async Example work ?! Pin
Dave Kreskowiak22-Apr-16 15:57
mveDave Kreskowiak22-Apr-16 15:57 
QuestionConversion from string "" to type 'Integer' is not valid Pin
kishore-201620-Apr-16 1:46
kishore-201620-Apr-16 1:46 
I have form1 and there is two flags ("Yes" and "No").when i select "Yes" and click on save button.It will open another form2.Once save form2 it will save form1 automatically.But it is giving error "conversion from string to type integer is not valid".please note that when i select "NO" it is not giving any error.please see my below code.

1)code for form1 save
Public Sub frmElogsheet_SAVE()

btneditelog.Enabled = False
btndelelog.Enabled = False
Dim conn As New SqlConnection
Dim cmd As New SqlCommand
' Dim dr As SqDataReader
conn = GetConnect()
conn.Open()
cmd.Connection = conn


Try

Dim code1 As Integer
Dim code2, code4, code5, code6, code7, code13 As String
Dim code8, code9 As Integer
Dim code3, code10, code11, code12 As Date

code1 = txtallocateelog.Text.ToString
code2 = txtvehicleElog.Text.ToString
code3 = txtRequestdateElog.Text.ToString
code4 = txtDestElog.Text.ToString
code5 = txtdeptElog.Text.ToString
code6 = txttravellerElog.Text.ToString
code7 = txtdvr2.Text.ToString
code8 = txtkmreaddept.Text.ToString
code9 = txtkmarr.Text.ToString
code10 = dtpdepttime.Text.ToString
code11 = dtparr.Text.ToString
code12 = dtpovertime.Text.ToString
code13 = Combacci.Text

'g900 = code2 'it will pass value to accident form

cmd.CommandText = "insert into tbElogsheet(Allocate_id,Number_plate,Depart_date,Destination,Department,Traveller,NAME,km_read_dept,km_read_arr,Departure_time,Arrival_time,Over_time,Accident) VALUES (" & code1 & ",'" & code2 & "','" & code3 & "','" & code4 & "','" & code5 & "','" & code6 & "','" & code7 & "'," & code8 & "," & code9 & ",'" & code10 & "','" & code11 & "','" & code12 & "','" & code13 & "')"
cmd.ExecuteNonQuery()
MsgBox("ELOGSHEET Added Sucessfully")

'frmElogsheet_clear() 'clear elogsheet items after saving

'txtkmreaddept.Text = g101

Catch ex As Exception
MsgBox(ex.Message)
End Try
'conn.Close()
End Sub
2)

Private Sub btnsaveElogsheet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Try
g900 = txtvehicleElog.Text.ToString
G901 = txtRequestdateElog.Text.ToString
G902 = txtdvr2.Text.ToString

Dim t13 As String

t13 = Combacci.Text.ToString



If t13 = ("Yes") Then


Dim frmeAccident As New frmeAccident 'Dim f1 As New frmeAccident()
frmeAccident.Show()

'Dim f1 As New frmeAccident()

Else
frmElogsheet_SAVE()
frmElogsheet_clear() 'clear elogsheet items after saving
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try

End Sub
3)Save for form2

Private Sub btnsaveacc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsaveacc.Click
Dim conn As New SqlConnection
Dim cmd As New SqlCommand
' Dim dr As SqDataReader
conn = GetConnect()
conn.Open()
cmd.Connection = conn

Try
'frmElogsheet.frmElogsheet_SAVE() 'CALL procedure frmElogsheet_SAVE() from frmElogsheet

Dim t2, t3, t4, t5, t6, t7, t8, t9 As String
Dim t1 As Integer

t1 = txtaccident.Text
t2 = txtaccplate.Text
t3 = txtdriver.Text
t4 = dtpeaccdept.Text
t5 = Cmbpolice.Text
t6 = txtlocacc.Text
t7 = txtamnt.Text
t8 = txtdesc.Text
t9 = Combacctype.Text


cmd.CommandText = "insert into tbeAccident values(" & t1 & ",'" & t2 & "','" & t3 & "','" & t4 & "','" & t5 & "','" & t6 & "'," & t7 & ",'" & t8 & "','" & t9 & "')"
cmd.ExecuteNonQuery()
MsgBox("Data Added Sucessfully")

'CODE CHANGES START

'cmd.CommandText = "Select * from tbDept_proj"
'Dim Adpt As New SqlDataAdapter(cmd.CommandText, conn)
'Dim ds As New DataSet()
'Adpt.Fill(ds, "tbDept_proj")
'grdviewdept.DataSource = ds.Tables("tbDept_proj")

'CODE CHANGES END

'frmeAccident_clear()

'close form start
'Dim frmeAccident As New frmeAccident
'frmeAccident.Close()

'Close()

'close form end

frmElogsheet.frmElogsheet_SAVE() 'CALL procedure frmElogsheet_SAVE() from frmElogsheet

Close()


Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub

please help on this article urgently.
AnswerRe: Conversion from string "" to type 'Integer' is not valid Pin
Richard MacCutchan20-Apr-16 2:02
mveRichard MacCutchan20-Apr-16 2:02 
AnswerRe: Conversion from string "" to type 'Integer' is not valid Pin
Sascha Lefèvre20-Apr-16 2:29
professionalSascha Lefèvre20-Apr-16 2:29 
AnswerRe: Conversion from string "" to type 'Integer' is not valid Pin
CHill6020-Apr-16 2:37
mveCHill6020-Apr-16 2:37 
GeneralRe: Conversion from string "" to type 'Integer' is not valid Pin
kishore-201621-Apr-16 5:44
kishore-201621-Apr-16 5:44 
GeneralRe: Conversion from string "" to type 'Integer' is not valid Pin
Richard Deeming21-Apr-16 5:54
mveRichard Deeming21-Apr-16 5:54 
GeneralRe: Conversion from string "" to type 'Integer' is not valid Pin
CHill6021-Apr-16 6:17
mveCHill6021-Apr-16 6:17 
GeneralRe: Conversion from string "" to type 'Integer' is not valid Pin
kishore-201621-Apr-16 6:26
kishore-201621-Apr-16 6:26 
QuestionVB6 File not found: 'C:\Users\???\AppData\Local\Temp\VBB685.tmp' Pin
ThePotty120-Apr-16 1:07
ThePotty120-Apr-16 1:07 
AnswerRe: VB6 File not found: 'C:\Users\???\AppData\Local\Temp\VBB685.tmp' Pin
Dave Kreskowiak20-Apr-16 4:18
mveDave Kreskowiak20-Apr-16 4:18 
AnswerRe: VB6 File not found: 'C:\Users\???\AppData\Local\Temp\VBB685.tmp' Pin
CHill6021-Apr-16 6:13
mveCHill6021-Apr-16 6:13 
QuestionVBA minimum margin Pin
JR21219-Apr-16 21:00
JR21219-Apr-16 21:00 
SuggestionRe: VBA minimum margin Pin
Richard MacCutchan19-Apr-16 23:28
mveRichard MacCutchan19-Apr-16 23:28 
GeneralRe: VBA minimum margin Pin
JR21220-Apr-16 19:03
JR21220-Apr-16 19:03 
GeneralRe: VBA minimum margin Pin
Richard MacCutchan20-Apr-16 21:05
mveRichard MacCutchan20-Apr-16 21:05 
GeneralRe: VBA minimum margin Pin
JR21220-Apr-16 22:32
JR21220-Apr-16 22:32 
GeneralRe: VBA minimum margin Pin
Richard MacCutchan20-Apr-16 22:38
mveRichard MacCutchan20-Apr-16 22:38 
Questionrichtexbox1.selectionfont Pin
Member 1243617019-Apr-16 9:46
Member 1243617019-Apr-16 9:46 

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.