Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET VB10.0 VB.NET
If tBx1.Enabled = True Then
 
            Dim str As String
            str = " insert into WorkOrder (WorkOrderNo, Status,DateIssue,DateStarted,DateComplete,Milage,Type,Priority,CostCenter,PO#,InvoiceNo, AssignedTo ,Parts,Labor,Discount,Tax1,Tax2,Total, Note,Repair,Product,Laborname) values(" & CInt(tBx1.Text) & ",'" & Trim(cBx1.Text) & "','" & CDate(DTP1.Value) & "','" & CDate(DTP2.Value) & "','" & CDate(DTP3.Value) & "'," & CInt(tBx2.Text) & ",'" & Trim(cBx2.Text) & "','" & Trim(cBx3.Text) & "','" & Trim(cBx4.Text) & "'," & CInt(tBx3.Text) & "," & CInt(tBx4.Text) & "," & (cBx5.SelectedValue.ToString()) & "," & CInt(tBx5.Text) & "," & CInt(tBx6.Text) & "," & CInt(tBx7.Text) & "," & CInt(tBx8.Text) & "," & CInt(tBx9.Text) & "," & CInt(tBx10.Text) & ",'" & Trim(tBx11.Text) & "',""{0}"", ""{1}"", ""{2}"",'" & (ListView1.CheckedItems(0).Text) & "', '" & (ListView2.CheckedItems(0).Text) & "','" & (ListView3.CheckedItems(0).Text) & "'"
            Call connect()
            Dim cd As New System.Data.SqlClient.SqlCommand(str, cn)
            cd.Connection.Open()
            cd.ExecuteNonQuery()
            cd.Connection.Close()
            MsgBox(" Work Order Is Issued Successfully ")
            Call lockall()
            Me.Close()
            Call WorkOrderManagement.ListViewLoad()
            Call WorkOrderManagement.updatecombo1()
            Call WorkOrderManagement.updatecombo2()
        Else
            MsgBox(" Failed Try Again ")
        End If
Posted 24-Mar-13 22:21pm
Comments
Maciej Los at 25-Mar-13 4:46am
   
What's the question? Where is a problem?
Zubair Lohani at 25-Mar-13 5:43am
   
it does not working , gives the error index 0

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Try listView1.SelectedItems[0].SubItems[2].Text.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 310
1 OriginalGriff 285
2 Afzaal Ahmad Zeeshan 200
3 Sergey Alexandrovich Kryukov 195
4 BillWoodruff 180
0 OriginalGriff 6,499
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,193
3 Manas Bhardwaj 4,657
4 Maciej Los 4,120


Advertise | Privacy | Mobile
Web01 | 2.8.1411022.1 | Last Updated 25 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100