Click here to Skip to main content
12,405,543 members (59,116 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB .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 21:21pm
Comments
Maciej Los 25-Mar-13 4:46am
   
What's the question? Where is a problem?
Zubair Lohani 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 25 Mar 2013
Copyright © CodeProject, 1999-2016
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