Visual Studio is confusing (10)

1 Name: JonhD : 2007-06-05 07:39 ID:WP/zMcHx

I'm not sure if I'm anywhere near right. I've got 4 tables and I'm using a currencyManager for each of them.

Also this code I found and modified from this:

If ds.Tables(0).Rows("FirstName") is DBNull.Value Then

To this:

If DsMotorCycle1.Tables(0).Rows("make") Is DBNull.Value Then

Gives me an invalid cast from system string to integer error.

Original code found here:
http://www.codeproject.com/vb/net/NullSafeFunctions.asp

Now begins my crappy code. Line break in places that would cause
errors are because of my attempt to make the code fit in the post.
-----------------------------------

Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load

    string_PicHolder = "C:\burningwheel.bmp"
PictureBox1.Image = System.Drawing.Image.FromFile(string_PicHolder)
    DaMostRecentRepair.Fill(DsMotorCycle1)
DaEngine.Fill(DsMotorCycle1)
DaInsurance.Fill(DsMotorCycle1)
DaMainTable.Fill(DsMotorCycle1)
currmanager = Me.BindingContext(DsMotorCycle1, "MotorCycleMainTable")

currmanagerEngine =
Me.BindingContext(DsMotorCycle1, "motorcycle_engine_table")
currmanagerInsurance =
Me.BindingContext(DsMotorCycle1, "motorcycle_insurance_table")
currmanagerMostRecentRepair = Me.BindingContext(DsMotorCycle1, "mostRecentRepairJob_table")

    ' Check for DBNull
If DsMotorCycle1.Tables(0).Rows("make") Is DBNull.Value Then
Label13.Text = "No Records"
    Else
        currmanager.Position = 0
currmanagerEngine.Position = 0
currmanagerInsurance.Position = 0
currmanagerMostRecentRepair.Position = 0
Label13.Text = currmanager.Position
End If
End Sub

2 Name: #!/usr/bin/anonymous : 2007-06-05 19:19 ID:dpXokqJT

This thread makes me glad that I don't ever have to touch VB

3 Name: JonhD : 2007-06-07 10:59 ID:WP/zMcHx

Great. Now I found the pic box problem was because currency manager is pulling up the rows out of order and the row it was starting with didnt have an image address. 4 5 6 7 8 1 2 3. WTF.

4 Name: #!/usr/bin/anonymous : 2007-06-13 02:00 ID:Heaven

Give up the VB. It'll make your whole life much simpler.

5 Name: #!/usr/bin/anonymous : 2007-06-14 12:22 ID:Heaven

Visual Studio != VB

6 Name: #!/usr/bin/anonymous : 2007-06-16 08:54 ID:Heaven

Give up the Visual Studio also.

7 Name: JonhD : 2007-06-16 09:58 ID:WP/zMcHx

I upgraded to 2005 after writing that post. It makes me want to give programming altogether. The freaking run command is MIA.

8 Name: #!/usr/bin/anonymous : 2007-10-15 13:21 ID:Uvq2EFzC

>>7
USAN DER DEBUG OPTIAN.

My uni shitcanned VS because students complained it was too hard.
We dont have GCC or anything unix based, we're stuck on vanilla XP with BORLAND c++ 4.5 installed.

Think yourself lucky you can actualy do something more usefull on your compiler than loop hello world to the console.

9 Name: #!/usr/bin/anonymous : 2007-10-23 03:43 ID:aSBKwNb6

>>8
xLiveCd or portable Cygwin. /thread

10 Name: #!/usr/bin/anonymous : 2007-10-24 04:25 ID:38V52uMX

Dude, the rows collection is a collection of DataRows, not columns. You'd need to identify the row ordinal you're interested in:

If DsMotorCycle1.Tables(0).Rows(0).Item("make") Is DBNull.Value Then...

This thread has been closed. You cannot post in this thread any longer.