WackoWolf
Active member
I think I am on the right track. At least I hope I am. I am useing the "OpenFileDialog" to start when the program first runs to find the database. But when I click on the database I get this error. Could someone Please tell me what I am doing wrong. Since this is wrong could someone let me know how to do this right.
Thank You
WackoWolf
Here is the error.
"An unhandled exception of type 'System.NullReferenceException' occurred in microsoft.visualbasic.dll
Additional information: Object variable or With block variable not set."
And this is the code.
Thank You
WackoWolf
Here is the error.
"An unhandled exception of type 'System.NullReferenceException' occurred in microsoft.visualbasic.dll
Additional information: Object variable or With block variable not set."
And this is the code.
VB.NET:
[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] Form1_Load([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Object, [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.EventArgs) [/SIZE][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]MyBase[/COLOR][/SIZE][SIZE=2].Load
currManager = BindingContext(DsNetwork1, "tblFreeIP")
[/SIZE][SIZE=2][COLOR=#008000]' Fill The Dataset[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] OpenFileDialog1.ShowDialog = DialogResult.OK [/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]NetWork.dbm = OpenFileDialog1.FileName
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]
[/COLOR][/SIZE][SIZE=2]daNetwork.Fill(DsNetwork1)[/SIZE]
[SIZE=2]
[/SIZE][SIZE=2][COLOR=#008000]' Lock The Text Boxes So They Can't Be Change[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]
[/COLOR][/SIZE][SIZE=2]txtSite.ReadOnly = [/SIZE][SIZE=2][COLOR=#0000ff]True
[/COLOR][/SIZE][SIZE=2]txtEthernet0.ReadOnly = [/SIZE][SIZE=2][COLOR=#0000ff]True
[/COLOR][/SIZE][SIZE=2]txtEthernet1.ReadOnly = [/SIZE][SIZE=2][COLOR=#0000ff]True
[/COLOR][/SIZE][SIZE=2]txtCKID.ReadOnly = [/SIZE][SIZE=2][COLOR=#0000ff]True
[/COLOR][/SIZE][SIZE=2]txtSpeed.ReadOnly = [/SIZE][SIZE=2][COLOR=#0000ff]True
[/COLOR][/SIZE][SIZE=2]txtIPsubnet.ReadOnly = [/SIZE][SIZE=2][COLOR=#0000ff]True
[/COLOR][/SIZE][SIZE=2]txtIPaddress.ReadOnly = [/SIZE][SIZE=2][COLOR=#0000ff]True
[/COLOR][/SIZE][SIZE=2]txtHost.ReadOnly = [/SIZE][SIZE=2][COLOR=#0000ff]True
[/COLOR][/SIZE][SIZE=2]txtBroadcast.ReadOnly = [/SIZE][SIZE=2][COLOR=#0000ff]True
[/COLOR][/SIZE][SIZE=2]btnSave.Enabled = [/SIZE][SIZE=2][COLOR=#0000ff]False
[/COLOR][/SIZE][SIZE=2]edit = [/SIZE][SIZE=2][COLOR=#0000ff]False[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]' Show Position Of Record[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]
[/COLOR][/SIZE][SIZE=2]ShowPosition()
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]
[/COLOR][/SIZE]