The name "" does not exsist in the current context

Hey Experts,
I am trying to insert new informatio to oracle from a form. But I am getting an Error "The name "insertnamehere" does not exsist in the current context". I have the site uploading with the current code when I skip debugging but I want to know how to fix the errors. Heres the code:

using System;
 
using System.Data;
 
using System.Configuration;
 
using System.Web;
 
using System.Web.Security;
 
using System.Web.UI;
 
using System.Web.UI.WebControls;
 
using System.Web.UI.WebControls.WebParts;
 
using System.Web.UI.HtmlControls;
 
 
 
public partial class _Default : System.Web.UI.Page
{
 
    protected void submit_Click(object sender, EventArgs e)
    {
    
        string recieved = recievedby.Text;
        string input = inputby.Text;
        string datadate = dateinput.Text;
        string reqresponse = responserequired.Text;
 
 
        string contact_title = name_title.Text;
        string firstname = first_name.Text;
        string lastname = last_name.Text;
        string contact_position = position.Text;
        string contact_company = company.Text;
        string contact_email = email.Text;
        decimal contact_phone = Convert.ToDecimal(phone.Text);
        decimal contact_fax = Convert.ToDecimal(fax.Text);
        string contact_mailing = mailing.Text;
        string contact_relation = relation.Text;
 
        /*
        DBManager db = new DBManager();
        db.Provider.RunNonQueryCommand("INSERT INTO \"IIS_DATA_ENTRY\"(RECIEVED_BY, INPUT_BY, DATA_DATE, LEAD_SOURCE, REQ_RESPONSE) VALUES('" + recieved + "','" + input + "','aaa', '1', '" + reqresponse + "')");
        db.Provider.RunNonQueryCommand("INSERT INTO \"IIS_CONTACT\"(TITLE, FIRST_NAME, LAST_NAME, CONTACT_POSITION, CONTACT_COMPANY, CONTACT_PHONE, CONTACT_EMAIL, CONTACT_FAX, CONTACT_MAILING, CONTACT_RELATION) VALUES('" + contact_title + "','" + firstname + "','" + lastname + "', '" + contact_position + " ', '" + contact_company + "', '"+contact_phone+"', '" + contact_email + "', '"+contact_fax+"', '" + contact_mailing + " ', '" + contact_relation + "')");
        //db.Provider.RunNonQueryCommand("INSERT INTO \"IIS_FILE\"(INVESTOR_COMPANY, INVESTOR_CONTACT, PRESENT_LOCATION, INDUSTRIAL_SECTOR, BUILDING_REQUIRED, BUILDING_SIZE, LAND_REQUIRED, LAND_SIZE, NATURE_OF_USE, TRANSPORTATION_ACCESS, OUTSIDE_STORAGE, CEILING_HEIGHT, TRUCK_DOOR, GRADE_DOOR, SERVICE_WATER, SERVICE_SEWER, SERVICE_GAS, SERVICE_HYDRO, SERVICE_TELECOM, OTHER, TIME_START, TIME_END, MANICIPAL_CIRCULATION, FILE_STATUS, AMOUNT_INVESTED, JOBS, GROTH_OPPS, RELOCATION_REASON, CONTACT_ID, DATA_ENTRY_ID) VALUES ();;
        */
        }
 
}

Open in new window

DanHopperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Nirmalan NagenthiranCommented:
This means that whatever you are looking for is out of scope or does not exist. check your code behind also.
0
csharppCommented:
Maybe one of your string contains " ' " (apostrophe) character.
You have to escape all your strings or use parameters like in this code snippet.
Do not use apostrophe characters in the command, even if your parameter is string!

var cmd = new OracleCommand("INSERT INTO \"IIS_DATA_ENTRY\"(RECIEVED_BY, INPUT_BY, ...) VALUES(@RECIEVED_BY, @INPUT_BY, ...");
cmd.Parameters.AddWithValue("@RECIEVED_BY", recieved);
cmd.Parameters.AddWithValue("@INPUT_BY", input);
...

Open in new window

0
csharppCommented:

cmd.ExecuteNonQuery();

Open in new window

0
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

DanHopperAuthor Commented:
Thank you for the responses guys.  Look at what I had posted doesn't really give an explaination of what is wrong. Each text box value is giving the error  "The name "textboxname" does not exsist in the current context". The errors only show up after debugging and the page will still start up. The page does upload to the database and when I insert break points the values are shown in the textboxs. So I really am not sure what I have done wrong. Here is my updated code. I am going to post the .aspx page in 1 post and the .cs on my next post.
Thanks for the help again guys! You guys are life savers!

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="addnew.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
 
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Investment Inquiry Specifications</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<form id="edit_form" runat="server" method="post" action="">
        <div id="header">
	        <h1>Investment Inquiry Specifications</h1>
        </div>
        
        <div id="menu">
 
		    <ul>
			    <li><a href="main.aspx"> Home </a></li>
		    	<li><a href="addnew.aspx">Add New File</a></li>
		    	<li><a href="profile.aspx">Profile</a></li>
		    	<li><a href="admin.aspx">Admin</a></li>
		    	<li><a href="login.aspx">Logout</a></li>
		    	<li></li>
		    	<li class="search"><input type="text" name="search" value="Search" /><input type="submit" name="submit" value="Search"/> </li>
	
		    </ul>
 
        </div>
        
        <div id="content">
        
	    <div id="left">
	
            <table class="border" width="100%">
                <tr> 
                    <th colspan="5">
                        <h2> Inquire Specifications - Add new file</h2>
                    </th>
                </tr>
 
                <tr class="border">  
                    <td class="strong" colspan="1">  
                        Recieved by: 
                        <br /> 
                        <asp:TextBox id="recievedby" runat="server" /> 
                    </td>
 
        
                    <td colspan="1" rowspan="3">
      
                                         Source of lead: <br />
                        <asp:CheckBoxList id="leadsource" runat="server"> 
                            <asp:ListItem value="0" text="GTMA" />
                            <asp:ListItem value="1" text="MEDT" />
                            <asp:ListItem value="2" text="Realtor" />
                            <asp:ListItem value="3" text="Direct" />
                            <asp:ListItem value="4" text="Other" />
                        </asp:CheckBoxList>
                    </td>
                </tr>
   
                <tr>
                    <td class="strong">
                        Input By: 
                        <br />
                        <asp:TextBox id="inputby" runat="server" />
                    </td>
                </tr>
   
                <tr>
                     <td class="strong">
                        Date:  
                        <br />
                        <asp:TextBox id="dateinput" runat="server" />  
                     </td>
                </tr>
     
     
                <tr>
                    <td colspan="4" class="strong" id="responsecss" style="height: 35px"> 
                      <b> Response Require By: </b>  <asp:TextBox id="responserequired" runat="server" />    
                    </td>
 
               </tr>
            </table>
            
            <table class="border" width="100%">
                <tr>
                    <td colspan="5" class="strong">
                        Contact: 
                    </td>
                </tr>
                
                 <tr>
                    <td colspan="2">
                        Title: 
                    <br />
                        <asp:TextBox id="contacts_title" runat="server" />
 
 
                    </td> 
                    <td colspan="2" > 
                        First Name: 
                    <br />
                        <asp:TextBox id="first_name" runat="server" />   
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        Last Name: 
                    <br />
                        <asp:TextBox id="last_name" runat="server" />
 
 
                    </td> 
                    <td colspan="2" > 
                        Position: 
                    <br />
                        <asp:TextBox id="position" runat="server" />   
                    </td>
                </tr>
      
                <tr>
                    <td colspan="2">
                        Company: 
                    <br />
                        <asp:TextBox id="company" runat="server" /> 
                    </td> 
     
                    <td colspan="2"> 
                        Phone Number: 
                    <br />
                        <asp:TextBox id="phone" runat="server" /> 
                    </td>
 
                </tr>
                
                <tr>
                    <td colspan="2">
                        E-mail Address: 
                    <br />
                        <asp:TextBox id="email" runat="server" /> 
                    </td>
                    <td colspan="2"> 
                        Fax Number: 
                        <br />
                        <asp:TextBox id="fax" runat="server" />  
                    </td>
 
                </tr>
     
                <tr>
                    <td colspan="4">
                        Mailing Address:<br/><asp:TextBox id="mailing" runat="server" Width="640px" />
                    </td> 
 
                </tr>
                
                <tr>
                    <td colspan="4">
                        Relation to end user:<br/><asp:TextBox id="relation" runat="server" Width="640px" />
                    </td> 
 
                </tr>
            </table>
          
            <table class="border" width="100%">
                <tr> 
                    <td colspan="6" class="strong">
                        Investor Details:
                    </td>
                </tr>
     
                <tr>
                    <td colspan="1" style="width: 334px"> 
                        Company: <br /><asp:TextBox id="investors_company" runat="server" />
                    </td>
 
                    <td style="width: 419px"> 
                        Contact: <br />
                        <asp:TextBox id="investors_contact" runat="server" />
                    </td>
                </tr>
    
                <tr>
                    <td colspan="4">
                        Present Location:<br/><asp:TextBox id="location" runat="server" Width="640px" />
                    </td>
                </tr>
     
                <tr>
                    <td colspan="4"> 
                        Reason: (relocation/expansion) <br/><asp:TextBox id="reason" runat="server" Width="640px" />
                    </td>
                </tr>
                
                <tr>
                </tr>
                
                <tr>
                    <th class="strong" colspan="3"> 
                        Nature of Use:
                    </th>
                </tr>
     
                <tr>
                    <td colspan="2"> 
                            <asp:CheckBoxList id="natureofuse" runat="server"> 
                            <asp:ListItem value="1" text="Manufacturing" />
                            <asp:ListItem value="2" text="Warehouse" />
                            <asp:ListItem value="3" text="Corporate Services" />
                            <asp:ListItem value="4" text="Office" />
                            <asp:ListItem value="5" text="Retail" />
                        </asp:CheckBoxList>
 
                    </td>
                </tr>
                
                <tr>
                </tr>
                
                <tr> 
                    <td class="strong" colspan="6">
                        Industrial Sector: <br/><asp:TextBox id="sector" runat="server" Width="600" />
                    </td>
                </tr>
                
                <tr>
                    <td class="strong" style="width: 334px"> 
                        Requirements: 
                    </td> 
                </tr>
                <tr>
                    <td style="width: 419px"> 
                        Buildings Required: 
                            <asp:CheckBoxList id="building_req" runat="server"> 
                            <asp:ListItem value="0" text="Yes" />
                            <asp:ListItem value="1" text="No" />
                        </asp:CheckBoxList>
                        
                        Building Size:<br />
                       <asp:TextBox id="buildings_size" runat="server" />sq. ft
                    </td>
                    <td style="width: 465px">           
                        Land Required: 
                        <asp:CheckBoxList id="land_req" runat="server"> 
                            <asp:ListItem value="0" text="Yes" />
                            <asp:ListItem value="1" text="No" />
                        </asp:CheckBoxList>
                        Land Size: <br /> <asp:TextBox id="lands_size" runat="server" /> Acres
                    </td>
                </tr>
     
                <tr>
                    <td colspan="6"  style="height: 16px" > 
                        Project Name: <br /><asp:TextBox id="TextBox3" runat="server" /> 
                    </td>
                </tr>
                
                <tr>
                    <td colspan="6" class="strong">
                         <br />
                         Specifications/Notes:
                    </td>
                </tr>
    
                 <tr>
                    <th style="width: 334px">
                         Ceiling Height: 
                    </th>
                    <th> 
                        Doors(#):
                    </th>
                </tr>
                
                <tr>        
                    <td style="width: 419px">
                        <asp:TextBox id="ceiling_height" runat="server" />
                    </td>        
                    <td rowspan="1" style="width: 465px" >   
                        Truck Level: <br /> <asp:TextBox id="trucks_door" runat="server" />
                    </td>
                    <td> 
                        Grade Level:<br /> <asp:TextBox id="grades_door" runat="server" />
                    </td>
                </tr>
        
                <tr> 
                    <th style="width: 334px"> 
                        Required Services:
                    </th>
                    <th> 
                        Transportation Access:
                    </th>
                    <th>
                        Outdoor Storage
                    </th>
                </tr>
                
                <tr>
                    <td style="width: 419px"> 
                        <asp:CheckBoxList id="service_water" runat="server"> 
                            <asp:ListItem value="1" text="Water" />
                        </asp:CheckBoxList>
                        <asp:CheckBoxList id="service_sewer" runat="server"> 
                            <asp:ListItem value="1" text="Sewer" />
                        </asp:CheckBoxList>     
                        <asp:CheckBoxList id="service_gas" runat="server"> 
                            <asp:ListItem value="1" text="Gas" />
                        </asp:CheckBoxList> 
                        <asp:CheckBoxList id="service_hydro" runat="server"> 
                            <asp:ListItem value="1" text="Hydro" />
                        </asp:CheckBoxList>
                        <asp:CheckBoxList id="service_telcom" runat="server"> 
                            <asp:ListItem value="1" text="Telcom" />
                        </asp:CheckBoxList>
                     </td>     
                    <td colspan="1" style="width: 5px">
                        <asp:CheckBoxList id="transportationtype" runat="server"> 
                        <asp:ListItem value="1" text="Highway" />
                        <asp:ListItem value="2" text="Railway" />
                        <asp:ListItem value="3" text="Port" />
                        <asp:ListItem value="4" text="Airport" />
                        </asp:CheckBoxList>
                    </td>
     
                    <td valign="top">
                        <asp:RadioButtonList id="outdoorstorage" runat="server"> 
                        <asp:ListItem value="1" text="Yes" />
                        <asp:ListItem value="0" text="No" />
                        </asp:RadioButtonList>
                    </td>    
                </tr>
                
                <tr>
                </tr>
        </table>
   
   
   
        <table class="border" width="100%">
            <tr>
                <td class="strong" colspan="4"> 
                    General Notes:
                </td>
            </tr>
     
            <tr>
                <td colspan="2"> 
                    Number of Jobs:
                    <br />
                    <asp:TextBox id="number_of_jobs" runat="server" /> 
                </td>
                <td colspan="2">
                    Amount Invested:
                    <br />
                    <asp:TextBox id="amount_invested" runat="server" />
                </td>
                <td colspan="2">
                    Groth Oppertinities:
                <br />
                    <asp:TextBox id="growth_opps" runat="server" />
                </td>
            </tr>
     
            <tr>
                <td colspan="6"><br />
                    Other:(i.e. Local suppliers, customers)
                </td>
            </tr>
    
             <tr>
                <td colspan="6">
                    <asp:TextBox id="other_info" rows="8" width="640" TextMode="multiline" runat="server" />
 
                </td>
             </tr>
    
             <tr>
                <td class="strong">     
                    Timing:
                </td>
             </tr>
     
             <tr>
                <td colspan="2">
                    Contruction Start: <br /> <asp:TextBox id="time_start" runat="server" /> 
                </td>
                <td colspan="2">
                    Occupancy: <br /> <asp:TextBox id="time_end" runat="server" />
                </td>
             </tr>
        
             <tr>
                 <th class="strong" colspan="2">
                    Required Action: email:
                 </th>
             </tr>
             
             <tr>  
                 <td colspan="1"> Municipal Partners: </td>
                 <td> All <input type="checkbox" name="partners" value="partners" /></td>
                 <td colspan="1"> Realtors: (listed below)</td>
                 <td> <input type="checkbox" name="realtors" value="realitors" /></td>
             </tr>
             
             <tr>
                 <td colspan="6">
                    <table width="60%" class="border">
                        <tr>
                            <td>
                                City
                            </td>
                            <td> 
                                Sent 
                            </td>
                            <td style="width: 82px"> 
                                Recieved 
                            </td>
                            <td> 
                                City
                            </td>
                            <td style="width: 47px"> 
                                Sent 
                            </td>
                            <td style="width: 49px"> 
                                Recieved 
                            </td>
                        </tr>
 
                        <tr>
                            <td class="blue">
                                Ajax
                            </td>
                            <td class="blue">
                                <asp:CheckBox ID="ajaxsent" runat="server" />
                            </td>
                            <td class="blue">
                                <asp:CheckBox ID="ajaxrecieved" runat="server" />
                            </td>
                            <td class="blue">
                                Brock
                            </td>
                            <td class="blue">
                                <asp:CheckBox ID="brocksent" runat="server"/> 
                            </td>
                            <td class="blue"> 
                                <asp:CheckBox ID="brockrecieved" runat="server" />
                            </td>
                        </tr>
 
                        <tr>
                            <td class="blue">
                                Clarington
                            </td>
                            <td class="blue">
                                <asp:CheckBox ID="claringtonsent" runat="server" /> 
                            </td>
                            <td class="blue"> 
                                <asp:CheckBox ID="claringtonrecieved" runat="server" />
                            </td>
                            <td class="blue">
                                Pickering
                            </td>
                            <td class="blue">
                                <asp:CheckBox ID="pickeringsent" runat="server" />
                            </td>
                            <td class="blue">
                                <asp:CheckBox ID="pickeringrecieved" runat="server" />
                            </td>
                        </tr>
 
                        <tr>
                            <td class="blue">
                                Oshawa
                            </td>
                            <td class="blue">
                                <asp:CheckBox ID="oshawassent" runat="server" /> 
                            </td>
                            <td class="blue"> 
                                <asp:CheckBox ID="oshawarecieved" runat="server" />
                            </td>
                            <td class="blue"> 
                                Scugog
                            </td>
                            <td class="blue">
                                <asp:CheckBox ID="scugogsent" runat="server" /> 
                            </td>
                            <td class="blue""> 
                                <asp:CheckBox ID="scugogrecieved" runat="server" />
                            </td>
                        </tr>
 
                        <tr>
                            <td class="blue">
                                Uxbridge
                            </td>
                            <td class="blue">
                                <asp:CheckBox ID="uxbridgesent" runat="server" /> 
                            </td>
                            <td class="blue"> 
                                <asp:CheckBox ID="uxbridgerecieved" runat="server" />
                            </td>
                            <td class="blue"> 
                                Whitby
                            </td>
                            <td class="blue">
                                <asp:CheckBox ID="whitbysent" runat="server" /> 
                            </td>
                            <td class="blue"> 
                                <asp:CheckBox ID="whitbyrecieved" runat="server" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
     
        <table class="border" width="100%">
            <tr>
                <th colspan="4"> 
                    File Status 
                </th>
            </tr>
            
            <tr>
                <td>
                    Municipal Circulation: 
                </td>
                <td>
                    <asp:RadioButtonList id="RadioButtonList13" runat="server"> 
                    <asp:ListItem value="1" text="Yes" />
                    <asp:ListItem value="1" text="No" />
                    </asp:RadioButtonList>
                </td>
                <td> 
                    File
                </td>
                <td>
                    <asp:DropDownList id="drop1" runat="server">
                    <asp:ListItem>Active</asp:ListItem>
                    <asp:ListItem>Closed</asp:ListItem>
                    <asp:ListItem>Dormant</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
 
        </table>
        <table class="border" width="100%">
            <tr>
                <td>
                    Date Updated/Added:
                     <br /> 
                     <asp:TextBox id="dateupdated" runat="server" />
                </td>
                <td>
                    Time Updated/Added:
                    <br />
                    <asp:TextBox id="timeupdated" runat="server" /> 
                </td>
            </tr>
            <tr>
            <td colspan="3">
            Manual Update: <br />
            <asp:TextBox id="manualedit" runat="server"  rows="4" width="640" TextMode="multiline">
            </asp:TextBox>
            </td>
            
            </tr>
            <tr>
            <td>
            <asp:TextBox id="updatedby" runat="server" /> 
            </td>
            </tr>
            <tr>
                <td style="height: 26px">
                    <asp:Button  ID="update"  Text="update" OnClick="Update_Click" runat="server"/>
                  
 
                </td>
            </tr>
        </table>
        </div>
        </div>
      
        <div id="footer">
 
        </div>
    </form>
</body>
</html>

Open in new window

0
DanHopperAuthor Commented:
the .CS File
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
 
using Oracle.DataAccess.Client;
 
public partial class _Default : System.Web.UI.Page
 
{
 
 
 
    protected void Update_Click(object sender, EventArgs e)
    {
 
 
 
        string recieved = recievedby.Text;
        string input = inputby.Text;
        string datadate = dateinput.Text;
        string reqresponse = responserequired.Text;
 
        //leadsource checkboxlist
        decimal leadvalue = 0;
        for (int i = 0; i < leadsource.Items.Count; i++)
        {
            if (leadsource.Items[i].Selected)
            {
                leadvalue = i;
            }
        };
 
 
 
 
 
 
        //IIS_CONTACT TABLE
        string contact_title = contacts_title.Text;
        string firstname = first_name.Text;
        string lastname = last_name.Text;
        string contact_position = position.Text;
        string contact_company = company.Text;
        string contact_email = email.Text;
        decimal contact_phone = Convert.ToDecimal(phone.Text);
        decimal contact_fax = Convert.ToDecimal(fax.Text);
        string contact_mailing = mailing.Text;
        string contact_relation = relation.Text;
 
 
        //IIS_FILE TABLE
        string investor_company = investors_company.Text;
        string investor_contact = investors_contact.Text;
        string present_location = location.Text;
        string industrial_sectors = sector.Text;
 
        //Nature of use checkboxlist
        decimal natureuse = 0;
        for (int i = 0; i < natureofuse.Items.Count; i++)
        {
            if (natureofuse.Items[i].Selected)
            {
                natureuse = i;
            }
        };
 
 
 
        //Building Required Checkboxlist
        decimal buildingreq = 0;
        for (int i = 0; i < building_req.Items.Count; i++)
        {
            if (building_req.Items[i].Selected)
            {
                buildingreq = i;
            }
        };
 
        decimal building_sizes = Convert.ToDecimal(buildings_size.Text);
 
        //Land Required Checkboxlist
        decimal landreq = 0;
        for (int i = 0; i < land_req.Items.Count; i++)
        {
            if (land_req.Items[i].Selected)
            {
                landreq = i;
            }
        };
 
        decimal land_sizes = Convert.ToDecimal(lands_size.Text);
        string ceilings_height = ceiling_height.Text;
        decimal truck_door = Convert.ToDecimal(trucks_door.Text);
        decimal grade_door = Convert.ToDecimal(grades_door.Text);
 
        //string transportation;
        decimal transportation = 0;
        for (int i = 0; i < transportationtype.Items.Count; i++)
        {
            if (transportationtype.Items[i].Selected)
            {
                transportation = i;
            }
        };
 
        //Outdoor Storage Required 
        decimal storage = 0;
        for (int i = 0; i < outdoorstorage.Items.Count; i++)
        {
            if (outdoorstorage.Items[i].Selected)
            {
                storage = i;
            }
        };
 
        //Water Service Required Checkbox
        decimal waterservice = 0;
        for (int i = 0; i < service_water.Items.Count; i++)
        {
            if (service_water.Items[i].Selected)
            {
                waterservice = i;
            }
        };
        //Sewer Service Required
        decimal sewerservice = 0;
        for (int i = 0; i < service_sewer.Items.Count; i++)
        {
            if (service_sewer.Items[i].Selected)
            {
                sewerservice = i;
            }
        };
 
        //Gas Service Required
        decimal gasservice = 0;
        for (int i = 0; i < service_gas.Items.Count; i++)
        {
            if (service_gas.Items[i].Selected)
            {
                gasservice = i;
            }
        };
 
 
 
 
        //Hydro Service Required
        decimal hydroservice = 0;
        for (int i = 0; i < service_hydro.Items.Count; i++)
        {
            if (service_hydro.Items[i].Selected)
            {
                hydroservice = i;
            }
        };
        //Telcom Service Required
        decimal telcomservice = 0;
        for (int i = 0; i < service_telcom.Items.Count; i++)
        {
            if (service_telcom.Items[i].Selected)
            {
                telcomservice = i;
            }
        };
 
 
        decimal number_jobs = Convert.ToDecimal(number_of_jobs.Text);
        string invested = amount_invested.Text;
        string groth_opp = growth_opps.Text;
        string other = other_info.Text;
        string start_date = time_start.Text;
        string end_date = time_end.Text;
        string relocation_reason = reason.Text;
 
 
 
 
 
 
 
 
        DBManager db = new DBManager();
        OracleParameter[] parameters = new OracleParameter[] {
            new OracleParameter("RECIEVED_BY", recieved),
            new OracleParameter("INPUT_BY", input),
            new OracleParameter("DATA_DATE", datadate),
            new OracleParameter("LEAD_SOURCE", leadvalue),
            new OracleParameter("REQ_RESPONSE", reqresponse),
            new OracleParameter("DATA_ENTRY_ID", OracleDbType.Decimal, ParameterDirection.Output)
 
           
        };
 
 
 
        db.Provider.RunNonQueryCommand(@"
            INSERT INTO IIS_DATA_ENTRY
            (RECIEVED_BY, INPUT_BY, DATA_DATE, LEAD_SOURCE, REQ_RESPONSE) 
            VALUES
            (:RECIEVED_BY,:INPUT_BY,:DATA_DATE, :LEAD_SOURCE,:REQ_RESPONSE) RETURNING ID INTO :DATE_ENTRY_ID", parameters);
 
        decimal data_id = Convert.ToDecimal(parameters[5].Value.ToString());
 
 
        OracleParameter[] parameters1 = new OracleParameter[] {
            new OracleParameter("TITLE", contact_title),
            new OracleParameter("FIRST_NAME", firstname),
            new OracleParameter("LAST_NAME", lastname),
            new OracleParameter("CONTACT_POSITION", contact_position),
            new OracleParameter("CONTACT_COMPANY", contact_company),
            new OracleParameter("CONTACT_PHONE", contact_phone),
            new OracleParameter("CONTACT_EMAIL", contact_email),
            new OracleParameter("CONTACT_FAX", contact_fax),
            new OracleParameter("CONTACT_MAIL", contact_mailing),
            new OracleParameter("CONTACT_RELATION", contact_relation),
            new OracleParameter("NEWID", OracleDbType.Decimal, ParameterDirection.Output)
 
             
 
        };
 
        db.Provider.RunNonQueryCommand(@"
            INSERT INTO IIS_CONTACT 
            (TITLE, FIRST_NAME, LAST_NAME, CONTACT_POSITION, CONTACT_COMPANY, CONTACT_PHONE, CONTACT_EMAIL, CONTACT_FAX, CONTACT_MAILING, CONTACT_RELATION) 
            VALUES
            (:TITLE,:FIRST_NAME,:LAST_NAME,:CONTACT_POSITION, :CONTACT_COMPANY, :CONTACT_PHONE, :CONTACT_EMAIL, :CONTACT_FAX, :CONTACT_MAIL, :CONTACT_RELATION) RETURNING ID INTO :NEWID", parameters1); //RETURNING id INTO b
 
        decimal contact_id = Convert.ToDecimal(parameters1[10].Value.ToString());
 
 
        OracleParameter[] parameters2 = new OracleParameter[] {
            new OracleParameter("INVESTOR_COMPANY", investor_company),
            new OracleParameter("INVESTOR_CONTACT", investor_contact),
            new OracleParameter("PRESENT_LOCATION", present_location),
            new OracleParameter("INDUSTRIAL_SECTOR", industrial_sectors),
            new OracleParameter("BUILDING_REQUIRED", buildingreq),
            new OracleParameter("BUILDING_SIZE", building_sizes),
            new OracleParameter("LAND_REQUIRED", landreq),
            new OracleParameter("LAND_SIZE", land_sizes),
            new OracleParameter("NATURE_OF_USE", natureuse),
            new OracleParameter("TRANSPORTATION_ACCESS", transportation),
            new OracleParameter("OUTSIDE_STORAGE", storage),
            new OracleParameter("CEILING_HEIGHT", ceilings_height),
            new OracleParameter("TRUCK_DOOR", truck_door),
            new OracleParameter("GRADE_DOOR", grade_door),
            new OracleParameter("SERVICE_WATER", waterservice),
            new OracleParameter("SERVICE_SEWER", sewerservice),
            new OracleParameter("SERVICE_GAS", gasservice),
            new OracleParameter("SERVICE_HYDRO", hydroservice),
            new OracleParameter("SERVICE_TELECOM", telcomservice),
            new OracleParameter("OTHER", other),
            new OracleParameter("TIME_START", start_date),
            new OracleParameter("TIME_END", end_date),
            new OracleParameter("MANICIPAL_CIRCULATION", "1"),
            new OracleParameter("FILE_STATUS", "0"),
            new OracleParameter("AMOUNT_INVESTED", invested),
            new OracleParameter("JOBS", number_jobs),
            new OracleParameter("GROTH_OPPS", groth_opp),
            new OracleParameter("RELOCATION_REASON", relocation_reason),
            new OracleParameter("CONTACT_ID", contact_id),
            new OracleParameter("DATA_INPIT_ID", data_id)
 
 
    };
 
        db.Provider.RunNonQueryCommand(@"
            INSERT INTO IIS_FILE
            (INVESTOR_COMPANY, INVESTOR_CONTACT, PRESENT_LOCATION, INDUSTRIAL_SECTOR, BUILDING_REQUIRED, BUILDING_SIZE, LAND_REQUIRED, LAND_SIZE, NATURE_OF_USE, TRANSPORTATION_ACCESS, OUTSIDE_STORAGE, CEILING_HEIGHT, TRUCK_DOOR, GRADE_DOOR, SERVICE_WATER, SERVICE_SEWER, SERVICE_GAS, SERVICE_HYDRO, SERVICE_TELECOM, OTHER, TIME_START, TIME_END, MANICIPAL_CIRCULATION, FILE_STATUS, AMOUNT_INVESTED, JOBS, GROTH_OPPS, RELOCATION_REASON, CONTACT_ID, DATA_ENTRY_ID) 
             VALUES 
            (:INVESTOR_COMPANY, :INVESTOR_CONTACT, :PRESENT_LOCATION, :INDUSTRIAL_SECTOR, :BUILDING_REQUIRED, :BUILDING_SIZE,:LAND_REQUIRED,:LAND_SIZE, :NATURE_OF_USE, :TRANSPORTATION_ACCESS, :OUTSIDE_STORAGE, :CEILING_HEIGHT, :TRUCK_DOOR, :GRADE_DOOR, :SERVICE_WATER, :SERVICE_SEWER, :SERVICE_GAS, :SERVICE_HYDRO,:SERVICE_TELECOM,:OTHER, :TIME_START, :TIME_END, :MANICIPAL_CIRCULATION, :FILE_STATUS, :AMOUNT_INVESTED, :JOBS, :GROTH_OPPS, :RELOCATION_REASON, :CONTACT_ID, :DATA_ENTRY_ID)", parameters2);
 
 
 
    }
}

Open in new window

0
Nirmalan NagenthiranCommented:
Change the CodeFile="addnew.aspx.cs" to CodeFile="default.aspx.cs" and try

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="default.aspx.cs" Inherits="_Default" %>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DanHopperAuthor Commented:
Changing the Codefile to default does not work. But I really wish it did! These errors are driving me nuts.
0
DanHopperAuthor Commented:
You were right NNirmalan. After I moved all the code from the addnew.aspx.cs to default.aspx.cs and changed the codefile it worked. Thanks for the help.
0
DanHopperAuthor Commented:
Thanks for the help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.