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
This thread makes me glad that I don't ever have to touch VB
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.
Give up the VB. It'll make your whole life much simpler.
Visual Studio != VB
Give up the Visual Studio also.
I upgraded to 2005 after writing that post. It makes me want to give programming altogether. The freaking run command is MIA.
>>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.
>>8
xLiveCd or portable Cygwin. /thread
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...