Click here to Skip to main content
15,887,485 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Retrive data from .dbf based on 2 fields in Text file Pin
Henry Minute14-May-09 8:13
Henry Minute14-May-09 8:13 
GeneralRe: Retrive data from .dbf based on 2 fields in Text file Pin
vijay248214-May-09 9:45
vijay248214-May-09 9:45 
QuestionHow to:Error providers Pin
Gram Letoaba14-May-09 4:16
Gram Letoaba14-May-09 4:16 
AnswerRe: How to:Error providers Pin
Jay Royall14-May-09 4:20
Jay Royall14-May-09 4:20 
AnswerPhone number validator WebService Pin
David Mujica14-May-09 4:43
David Mujica14-May-09 4:43 
QuestionTransfer of data from listbox (vb express 2008) to table in msAccess Pin
sazd114-May-09 2:11
sazd114-May-09 2:11 
AnswerRe: Transfer of data from listbox (vb express 2008) to table in msAccess Pin
Henry Minute14-May-09 2:24
Henry Minute14-May-09 2:24 
GeneralRe: Transfer of data from listbox (vb express 2008) to table in msAccess Pin
sazd114-May-09 2:53
sazd114-May-09 2:53 
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim total As Integer
total = txtQuantity.Text * txtPrice.Text
txtAmount.Text = total
If ListBox1.Items.Count <> 0 Then
ListBox1.Items.RemoveAt(ListBox1.Items.Count - 1)
End If
ListBox1.Items.Add(txtId.Text + vbTab + txtDescription.Text + vbTab + txtQuantity.Text + vbTab + txtPrice.Text + vbTab + txtAmount.Text)
total = total + Integer.Parse(txtAmount.Text)
ListBox1.Items.Add("Total " + vbTab + vbTab + vbTab + total.ToString())
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

ListBox1.Items.Add("Id " + vbTab + "Description " + vbTab + "Quantity " + vbTab + "Price " + vbTab + "Amount ")
End Sub
Private Sub btnTransData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTransData.Click

Dim desc, qnty, price, amount As String
Dim Cmd As OleDb.OleDbCommand
Dim SQL As String
Dim objCmd As New OleDb.OleDbCommand
Dim Con = New OleDb.OleDbConnection ""Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Propriet rio\Desktop\bd2.mdb")

Dim id As Integer = 0
Con.Open()

For Each item As String In ListBox1.Items
If id <> 0 Then
Dim parts() As String = item.Split(" ")
SQL = "INSERT INTO TestTable (*) VALUES ('" & id.ToString & "', '" & parts(0) & "', " & parts(1) & ", '" & parts(2) & "', '" & parts(3) & "')"
Cmd = New OleDb.OleDbCommand(SQL, Con)
objCmd = New OleDb.OleDbCommand(SQL, Con)
objCmd.ExecuteNonQuery()
End If
id = id + 1
Next
Con.Close()
End Sub

it is giving the error ""IndexOutOfRangeExecption was unhandled""
kindly advise the correction.
GeneralRe: Transfer of data from listbox (vb express 2008) to table in msAccess Pin
Christian Graus14-May-09 3:05
protectorChristian Graus14-May-09 3:05 
GeneralRe: Transfer of data from listbox (vb express 2008) to table in msAccess Pin
Dave Kreskowiak14-May-09 3:25
mveDave Kreskowiak14-May-09 3:25 
QuestionRegarding Winsock control Pin
specialdreamsin14-May-09 1:00
specialdreamsin14-May-09 1:00 
AnswerRe: Regarding Winsock control Pin
Dave Kreskowiak14-May-09 1:56
mveDave Kreskowiak14-May-09 1:56 
GeneralRe: Regarding Winsock control Pin
Zaegra14-May-09 4:07
Zaegra14-May-09 4:07 
GeneralRe: Regarding Winsock control Pin
Dave Kreskowiak14-May-09 7:07
mveDave Kreskowiak14-May-09 7:07 
GeneralRe: Regarding Winsock control Pin
Zaegra14-May-09 8:54
Zaegra14-May-09 8:54 
GeneralRe: Regarding Winsock control Pin
Dave Kreskowiak14-May-09 9:30
mveDave Kreskowiak14-May-09 9:30 
GeneralRe: Regarding Winsock control [modified] Pin
specialdreamsin14-May-09 18:20
specialdreamsin14-May-09 18:20 
GeneralRe: Regarding Winsock control Pin
Zaegra14-May-09 22:49
Zaegra14-May-09 22:49 
GeneralRe: Regarding Winsock control Pin
Dave Kreskowiak15-May-09 2:25
mveDave Kreskowiak15-May-09 2:25 
QuestionUsing DBCombo on VB2008 Pin
Ener Leumas13-May-09 22:00
Ener Leumas13-May-09 22:00 
AnswerRe: Using DBCombo on VB2008 Pin
Dave Kreskowiak14-May-09 1:55
mveDave Kreskowiak14-May-09 1:55 
GeneralRe: Using DBCombo on VB2008 Pin
Ener Leumas14-May-09 18:32
Ener Leumas14-May-09 18:32 
QuestionSimilar Program Pin
vijay248213-May-09 21:31
vijay248213-May-09 21:31 
GeneralRe: Similar Program Pin
Steven J Jowett13-May-09 22:42
Steven J Jowett13-May-09 22:42 
Questionhow to call c++ DLL in vb 6 Pin
zhiyuan1613-May-09 16:54
zhiyuan1613-May-09 16:54 

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.