Current location: Hot Scripts Forums » Programming Languages » ASP.NET » Free Year's Hosting to the person that solves this


Free Year's Hosting to the person that solves this

Reply
  #1 (permalink)  
Old 04-18-04, 12:18 AM
techknow's Avatar
techknow techknow is offline
Newbie Coder
 
Join Date: Apr 2004
Location: Lomita, Ca
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Free Year's Hosting to the person that solves this

100 MB Webspace free for a year to the first person that can tell me why this doesn't work and how to fix it so that it does work...

My hosting site is at http://atkhost.com if you would like more info about my services... (Not trying to spam here...)

Ok Here's the code, it's pretty simple;



<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<Script Runat="Server">

Sub Button_Click( s As Object, e As EventArgs )
Dim conlistings As OleDbConnection
Dim strInsert As String
Dim cmdInsert As OleDbCommand

conlistings = New OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=d:\websites\justoneguy.com\data\listings.md b" )
strInsert = "Insert Into Listings ( Address, City, Price, Bedrooms, Bathrooms, Views, Description, Comments ) Values ( @Address, @City, @Price, @Bedrooms, @Bathrooms, @Views, @Description, @Comments )"
cmdInsert = New OleDbCommand( strInsert, conlistings )
cmdInsert.Parameters.Add( "@Address", Address.Text )
cmdInsert.Parameters.Add( "@City", City.Text )
cmdInsert.Parameters.Add( "@Price", Price.Text )
cmdInsert.Parameters.Add( "@Bedrooms", Bedrooms.Text )
cmdInsert.Parameters.Add( "@Bathrooms", Bathrooms.Text )
cmdInsert.Parameters.Add( "@Views", Views.Text )
cmdInsert.Parameters.Add( "@Description", PropDescription.Text )
cmdInsert.Parameters.Add( "@Comments", Comments.Text )
conlistings.Open()
cmdINsert.ExecuteNonQuery()
conlistings.Close()
End Sub
</Script>

<html>
<head><title>FormInsert.aspx</title></head>
<body>
<form Runat="Server">

<h2>Add New Listing</h2>

<b>Address:</b>
<br>
<asp:TextBox
ID="Address"
Runat="Server" />
<p>
<b>City:</b>
<br>
<asp:TextBox
ID="City"
Runat="Server" />
<p>

<b>Price:</b>
<br>
<asp:TextBox
ID="Price"
Runat="Server" />
<p>

<b>Bedrooms:</b>
<br>
<asp:TextBox
ID="Bedrooms"
Runat="Server" />
<p>

<b>Bathrooms:</b>
<br>
<asp:TextBox
ID="Bathrooms"
Runat="Server" />
<p>

<b>Views:</b>
<br>
<asp:TextBox
ID="Views"
Runat="Server" />
<p>

<b>Description:</b>
<br>
<asp:TextBox
ID="Description"
Runat="server" Columns="3" />
<p>
<b>Comments:</b>
<br>
<asp:TextBox
ID="Comments"
Runat="Server" />
<p>
<asp:Button
Text="Add!"
OnClick="Button_Click"
Runat="Server" />

</form>
</body>
</html>
__________________
Best Regards,

TechKnow
Head-Nerd-In-Charge
Advanced Tech Knowledge

Http://justoneguy.com

http://atkhost.com
Reply With Quote
  #2 (permalink)  
Old 04-18-04, 03:26 AM
kiddu kiddu is offline
New Member
 
Join Date: Apr 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
here is the problem:

cmdInsert.Parameters.Add( "@Description", PropDescription.Text)

PropDescription is not defined. You might wanted to use description.text

HTH
Kiddu
Reply With Quote
  #3 (permalink)  
Old 04-18-04, 01:15 PM
techknow's Avatar
techknow techknow is offline
Newbie Coder
 
Join Date: Apr 2004
Location: Lomita, Ca
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Ugh Still Returns Error

Still doesn't work... Good call though... You can still have your free hosting anyway.

Thanks!
__________________
Best Regards,

TechKnow
Head-Nerd-In-Charge
Advanced Tech Knowledge

Http://justoneguy.com

http://atkhost.com
Reply With Quote
  #4 (permalink)  
Old 04-19-04, 03:52 PM
techknow's Avatar
techknow techknow is offline
Newbie Coder
 
Join Date: Apr 2004
Location: Lomita, Ca
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Duh

More Proof I am a knucklehead!

I had to also change the form field indentifier!!!

No wonder the guys from MIT aren't returning my calls...
__________________
Best Regards,

TechKnow
Head-Nerd-In-Charge
Advanced Tech Knowledge

Http://justoneguy.com

http://atkhost.com
Reply With Quote
  #5 (permalink)  
Old 04-20-04, 01:01 PM
wessamzeidan wessamzeidan is offline
Newbie Coder
 
Join Date: Apr 2004
Location: Lebanon
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
I'm not sure but I think you have to change your sql query to this


strInsert = "Insert Into Listings ( Address, City, Price, Bedrooms, Bathrooms, Views, Description, Comments ) Values ( ?, ?, ?, ?, ?, ?, ?, ?)"

cmdInsert.Parameters.Add( "Address", Address.Text )
cmdInsert.Parameters.Add( "City", City.Text )
cmdInsert.Parameters.Add( "Price", Price.Text )
cmdInsert.Parameters.Add( "Bedrooms", Bedrooms.Text )
cmdInsert.Parameters.Add( "Bathrooms", Bathrooms.Text )
cmdInsert.Parameters.Add( "Views", Views.Text )
cmdInsert.Parameters.Add( "Description", PropDescription.Text )
cmdInsert.Parameters.Add( "Comments", Comments.Text )

it works fine for me........give it a try
Reply With Quote
  #6 (permalink)  
Old 04-27-04, 11:18 AM
techknow's Avatar
techknow techknow is offline
Newbie Coder
 
Join Date: Apr 2004
Location: Lomita, Ca
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
I got it working...

Thanks though. PM me if you want your hosting!

Thanks again to all!
__________________
Best Regards,

TechKnow
Head-Nerd-In-Charge
Advanced Tech Knowledge

Http://justoneguy.com

http://atkhost.com
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Free PHP hosting! soapbath General Advertisements 1 05-27-04 03:42 PM
Huge April Hosting Special ! - Plus Free Hosting Offer ! bjdea1 General Advertisements 0 04-17-04 08:52 AM
March Shared & Reseller Hosting Special - PLUS FREE Hosting Offer ! bjdea1 General Advertisements 0 03-10-04 06:27 AM
Need Partner, to Start Free Hosting MaTriX Internet Job Offers & Assistance 0 11-02-03 05:15 PM
ICESTORM.COM – Partner with us & Earn FREE web hosting! icestorm General Advertisements 0 08-11-03 06:43 PM


All times are GMT -5. The time now is 02:53 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.