Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 9th, 2004, 02:11 PM
Registered User
 
Join Date: Apr 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default System.NullReferenceException: Object reference no

Hi
I am getting error while i am inserting data in the database. my code is:

If pnss.Visible = True Then
            Response.Write("I am panel for splitspoon")

            smssinsert = "INSERT INTO tempsplitspoon ("
            smssinsert &= "[RecordID], [HammerType], [HammerTypeTop], [HammerTypeBottom], [HammerSize], "
            smssinsert &= "[HammerSizeTop], [HammerSizeBottom], [PenetrationTop], [PenetrationBottom], "
            smssinsert &= "[RecoveryLength], [SamplerLength], [InnerDiameter], [OuterDiameter], "
            smssinsert &= "[LinerInfo], [Catcher], [SequentialSampleNo]) VALUES ("
            smssinsert &= record.Text & ",'"
            smssinsert &= txtssht.Text & "',"
            smssinsert &= txtsshtt.Text & ","
            smssinsert &= txtsshtb.Text & ","
            smssinsert &= txtsshs.Text & ","
            smssinsert &= txtsshst.Text & ","
            smssinsert &= txtsshsb.Text & ","
            smssinsert &= txtsspt.Text & ","
            smssinsert &= txtsspb.Text & ","
            smssinsert &= txtssrl.Text & ","
            smssinsert &= txtsssl.Text & ","
            smssinsert &= txtssid.Text & ","
            smssinsert &= txtssod.Text & ",'"
            smssinsert &= txtssli.Text & "','"
            smssinsert &= txtssc.Text & "',"
            smssinsert &= txtssssn.Text & ")"
            Response.Write("**" & smssinsert & "**")
            Response.Flush()
            Dim addsmss As New OleDbCommand(smssinsert, myconnection)
            i = addsmss.ExecuteNonQuery()

        ElseIf pnsbt.Visible = True Then

            Response.Write("I am panel for shelbytube")

            smsbtinsert = "INSERT INTO tempshelbytube ("
            smsbtinsert &= "[RecordID], [InnerDiameter], [OuterDiameter], [Length], [PenetrationTop], "
            smsbtinsert &= "[PenetrationBottom], [RecoveryLength], [LinerInfo], [SequentialSampleNo]) VALUES ("
            smsbtinsert &= record.Text & ","
            smsbtinsert &= txtsbtid.Text & ","
            smsbtinsert &= txtsbtod.Text & ","
            smsbtinsert &= txtsbtl.Text & ","
            smsbtinsert &= txtsbtpt.Text & ","
            smsbtinsert &= txtsbtpb.Text & ","
            smsbtinsert &= txtsbtrl.Text & ",'"
            smsbtinsert &= txtsbtli.Text & "',"
            smsbtinsert &= txtsbtssn.Text & ")"
            Dim addsmsbt As New OleDbCommand(smsbtinsert, myconnection)
            i = addsmsbt.ExecuteNonQuery()

I dont understand where the error is.But rest of the similar code is working fine. So, please help.
Thanks

Regards
Nidy
 
Old June 9th, 2004, 02:13 PM
Registered User
 
Join Date: Apr 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry i forget to mention the error . it is

System.NullReferenceException: Object reference not set to an instance of an object.


 
Old June 9th, 2004, 09:17 PM
Authorized User
 
Join Date: May 2004
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

mm.. have u instantiated all the objects?






Similar Threads
Thread Thread Starter Forum Replies Last Post
System.NullReferenceException JayLou BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 April 6th, 2007 12:55 PM
System.NullReferenceException: Object reference no HelpWanted ASP.NET 1.0 and 1.1 Basics 11 October 24th, 2006 04:50 PM
System.NullReferenceException lwheless BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 September 24th, 2006 05:47 AM
System.NullReferenceException: Object reference... nordestgaard All Other Wrox Books 4 January 7th, 2004 01:06 AM
[NullReferenceException: Object reference not set creiche ASP.NET 1.0 and 1.1 Basics 3 September 23rd, 2003 08:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.