Welcome Guest.   Make a donation to an author on the site August 27, 2014, 10:13:20 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
View the new Member Awards and Badges page.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: ASP.NET Issues  (Read 1414 times)
chedabob
Participant
*
Posts: 34


C# Master (if only!!!)

View Profile Give some DonationCredits to this forum member
« on: May 18, 2007, 11:04:49 AM »

I've been asked to code a form for a website. The form contains 40 or so textboxes, so I just wrote some really long INSERT query (if there is a better way, please suggest it) to insert them in. Now, I keep getting "Object reference not set to an instance of an object" on the following code

[copy or print]
OleDbCommand theCommand = new OleDbCommand();
        theCommand.Connection = theConnection;
        theCommand.CommandText = @"INSERT INTO [SQLserverSQL].[dbo].[Records]
           ([computerName]
           ,[operatingSystem]
           ,[serialNumber]
           ,[hardwareManufacturer]
           ,[modelType]
           ,[warrantyExpiration]
           ,[serverFunction]
           ,[retailCorporate]
           ,[dcenterStoreLocation]
           ,[rackNumber]
           ,[supportGroup]
           ,[cellNumber]
           ,[Product Number]
           ,[localAdminID]
           ,[localAdminPW]
           ,[cpuNumber]
           ,[cpuType]
           ,[cpuSpeed]
           ,[networkAdapters]
           ,[speedDuplex]
           ,[primaryIP]
           ,[secondaryIP]
           ,[riloName]
           ,[riloIP]
           ,[totalMemory]
           ,[totalDiskSpace]
           ,[C_OS]
           ,[D_Data]
           ,[E_Apps]
           ,[networkCableID]
           ,[power]
           ,[changeWindow]
           ,[appName]
           ,[businessOwner]
           ,[appVendor]
           ,[appSupportGroup]
           ,[appFunction]
           ,[appCode]
           ,[specialRequirements])
     VALUES
           (" + computerName.ToString()
           + "," + operatingSystem.SelectedIndex.ToString()
           + "," + serialNumber.ToString()
           + "," + hardwareManufacturer.SelectedIndex.ToString()
           + "," + modelType.SelectedIndex.ToString()
           + "," + warrantyExpiration.ToString()
           + "," + serverFunction.SelectedItem.ToString()
           + "," + retailCorporate.SelectedItem.ToString()
           + "," + dCenterStoreLocation.SelectedItem.ToString()
           + "," + gridLocation.SelectedItem.ToString()
           + "," + supportGrp.ToString()
           + "," + cellPagerNumber.ToString()
           + "," + productNumber.ToString()
           + "," + localAdminID.ToString()
           + "," + localAdminPW.ToString()
           + "," + cpuNumber.SelectedItem.ToString()
           + "," + cpuType.SelectedItem.ToString()
           + "," + cpuSpeed.SelectedItem.ToString()
           + "," + netAdapters.SelectedItem.ToString()
           + "," + speedDuplex.SelectedItem.ToString()
           + "," + primaryIP.ToString()
           + "," + secondaryIP.ToString()
           + "," + riloName.ToString()
           + "," + riloIP.ToString()
           + "," + totalMemory.ToString()
           + "," + totalDiskSpace.ToString()
           + "," + C_OS.SelectedItem.ToString()
           + "," + D_Data.SelectedItem.ToString()
           + "," + E_Apps.SelectedItem.ToString()
           + "," + netCableID.ToString()
           + "," + power.ToString()
           + "," + changeWindow.ToString()
           + "," + appName.ToString()
           + "," + businessOwner.ToString()
           + "," + appVendor.ToString()
           + "," + appSupportGrp.ToString()
           + "," + appFunc.ToString()
           + "," + appCode.ToString()
           + "," + specReq.ToString() + ")";

It occurs on the third line, but I don't know what's causing it, as this is the way I've always done it before. Any ideas?
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.031s | Server load: 0.02 ]