Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 9th, 2004, 02:11 PM
Registered User
 
Join Date: Apr 2004
Location: , , .
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
Reply With Quote
  #2 (permalink)  
Old June 9th, 2004, 02:13 PM
Registered User
 
Join Date: Apr 2004
Location: , , .
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.


Reply With Quote
  #3 (permalink)  
Old June 9th, 2004, 09:17 PM
Authorized User
 
Join Date: May 2004
Location: , , .
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

mm.. have u instantiated all the objects?

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:03 AM.


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