Gamingforce Interactive Forums
85242 35212

Go Back   Exploding Garrmondo Weiner Interactive Swiss Army Penis > Garrmondo Network > Help Desk
Register FAQ GFWiki Community Donate Arcade ChocoJournal Calendar

Notices

Welcome to the Exploding Garrmondo Weiner Interactive Swiss Army Penis.
GFF is a community of gaming and music enthusiasts. We have a team of dedicated moderators, constant member-organized activities, and plenty of custom features, including our unique journal system. If this is your first visit, be sure to check out the FAQ or our GFWiki. You will have to register before you can post. Membership is completely free (and gets rid of the pesky advertisement unit underneath this message).


VB code problem (listbox)
Closed Thread
 
Thread Tools
Grundlefield Earth
I'm sorry buddy!


Member 65

Level 32.03

Mar 2006


Old Oct 29, 2006, 12:42 PM Local time: Oct 29, 2006, 12:42 PM #1 of 6
VB code problem (listbox)

Quote:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim myDataReader As OleDb.OleDbDataReader = Nothing
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data source = a:\DataReaderAssign.mdb;Persist Security Info=False"
Dim myConnection As New OleDb.OleDbConnection(connectionString)

Dim myCommand As New OleDb.OleDbCommand{"SELECT * FROM DataReaderAssign", myConnection)
'Add header information to the listbox
lstData.Items.Add("ProdID" & vbTab & "Name" & vbTab & "NumberInStock" & vbTab & "Price" & vbTab & "Total Value")
Try
'Open(Connection)
myConnection.Open()
myDataReader = myCommand.ExecuteReader
'Declare variables to capture the quantity and price of each item
Dim intQuant As Integer
Dim sngPrice As Single
'Read data into the variable
While myDataReader.Read()
sngPrice = Val(myDataReader("Price"))
intQuant = Val(myDataReader("NumberInStock"))

'Populate the listbox with field data and the calculated value for each inventory item
lstData.Items.Add(myDataReader("ProdID") & vbTab & myDataReader("Name") & vbTab & myDataReader("NumberInStock") & vbTab & Format(myDataReader("Price"), "c") & vbTab & Format(sngPrice * intQuant, "c"))
End While
Finally
myConnection.Close()
End Try

End Sub
END OF STATEMENT EXPECTED ON DECLARATION OF MYCOMMAND. IT WONT TAKE STUPID SQL PROCEDURE.

Spoiler:
I asked teacher and he didnt even know


I'll probably just hand it in like this.

How ya doing, buddy?
Grundlefield Earth
I'm sorry buddy!


Member 65

Level 32.03

Mar 2006


Old Oct 29, 2006, 01:28 PM Local time: Oct 29, 2006, 01:28 PM #2 of 6
Somewhat, but I just wanted to get this fixed somehow or just hand the thing in. Its a VB class for no prior experience so while I sorta understand that, I sorta dont as well. You probably know what I mean. For the most part, we copied most of this out of the book we use just to get an understanding of the process, but for some reason there is still an error here, even though thats what they have in the book. hehe.

There's nowhere I can't reach.
Grundlefield Earth
I'm sorry buddy!


Member 65

Level 32.03

Mar 2006


Old Oct 29, 2006, 07:41 PM Local time: Oct 29, 2006, 07:41 PM #3 of 6
Unbelievable, I looked through that line so much. Stupid teacher couldnt even see it either. Man I even took java for two semesters. LoL. Closed.

This thing is sticky, and I don't like it. I don't appreciate it.
Closed Thread


Exploding Garrmondo Weiner Interactive Swiss Army Penis > Garrmondo Network > Help Desk > VB code problem (listbox)

Forum Jump


All times are GMT -5. The time now is 12:26 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2026, vBulletin Solutions, Inc.