Link to home
Start Free TrialLog in
Avatar of zeurx
zeurxFlag for United States of America

asked on

update database

ok i have dreamweaver mx 2004 for asp.net programing and i need to update a database and it worked in the last release but now then i click the submit button it just sends the user back to the admin page where the button to edit it is.... you clikc the edit button.... edit the information.... click submit... it redirects you to the admin page and dosent update the db(access 2000 database) i was wondering what would cause it just to stop working
ASKER CERTIFIED SOLUTION
Avatar of CoolATIGuy
CoolATIGuy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of zeurx

ASKER

ummm it shouldnt go back to that page.... it should display an error or go to the post to view which means there is no code but that of dreamweaver
Avatar of zeurx

ASKER

when i click the button it goes right back to the edit page when i take my security out and i dont know y
Avatar of zeurx

ASKER

This is the update code from dw...
<MM:Update
runat="server"
CommandText='<%# "UPDATE Main SET DaysLast=?, EBaySellingPrice=?, Link=?, ListingPrice=?, Payment=?, ReservePrice=?, SellingPrice=?, StartingPrice=?, TrackName=? WHERE TrackNumber=? AND DateStarted=?" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_ebaytrackerdatabase"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_ebaytrackerdatabase"] %>'
Expression='<%# Request.Form["MM_update"] == "form1" %>'
CreateDataSet="false"
Debug="true"
><Parameters>
  <Parameter Name="@DaysLast" Value='<%# ((Request.Form["Days"] != null) && (Request.Form["Days"].Length > 0)) ? Request.Form["Days"] : "" %>' Type="Integer" />  
  <Parameter Name="@EBaySellingPrice" Value='<%# ((Request.Form["EbayPrice"] != null) && (Request.Form["EbayPrice"].Length > 0)) ? Request.Form["EbayPrice"] : "" %>' Type="WChar" />  
  <Parameter Name="@Link" Value='<%# ((Request.Form["Link"] != null) && (Request.Form["Link"].Length > 0)) ? Request.Form["Link"] : "" %>' Type="WChar" />  
  <Parameter Name="@ListingPrice" Value='<%# ((Request.Form["ListPrice"] != null) && (Request.Form["ListPrice"].Length > 0)) ? Request.Form["ListPrice"] : "" %>' Type="WChar" />  
  <Parameter Name="@Payment" Value='<%# ((Request.Form["Payment"] != null) && (Request.Form["Payment"].Length > 0)) ? Request.Form["Payment"] : "" %>' Type="WChar" />  
  <Parameter Name="@ReservePrice" Value='<%# ((Request.Form["Reserve"] != null) && (Request.Form["Reserve"].Length > 0)) ? Request.Form["Reserve"] : "" %>' Type="WChar" />  
  <Parameter Name="@SellingPrice" Value='<%# ((Request.Form["SoldPrice"] != null) && (Request.Form["SoldPrice"].Length > 0)) ? Request.Form["SoldPrice"] : "" %>' Type="WChar" />  
  <Parameter Name="@StartingPrice" Value='<%# ((Request.Form["StartPrice"] != null) && (Request.Form["StartPrice"].Length > 0)) ? Request.Form["StartPrice"] : "" %>' Type="WChar" />  
  <Parameter Name="@TrackName" Value='<%# ((Request.Form["ItemName"] != null) && (Request.Form["ItemName"].Length > 0)) ? Request.Form["ItemName"] : "" %>' Type="WChar" />  
  <Parameter Name="@TrackNumber" Value='<%# ((Request.Form["ItemID"] != null) && (Request.Form["ItemID"].Length > 0)) ? Request.Form["ItemID"] : "" %>' Type="WChar" />  
  <Parameter Name="@DateStarted" Value='<%# ((Request.Form["ItemID"] != null) && (Request.Form["ItemID"].Length > 0)) ? Request.Form["ItemID"] : "" %>' Type="WChar" />  
</Parameters>
</MM:Update>

This is the form code...
<form runat='server' name='form1'  method='POST'>
...
<table width="433" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td><span class="style5">Item Name :</span>                    <input name="ItemName" type="text" id="ItemName" value='<%# DataSet1.FieldValue("TrackName", Container) %>' width="114"></td>
                  <td width="63"></td>
                  <td class="style5">Item ID :
                    <input name="ItemID" type="text" id="ItemID" value='<%# Double.Parse(DataSet1.FieldValue("TrackNumber", Container)).ToString("F") %>' width="114"></td>
                </tr>
              </table>
              <table width="433" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td>Ebay Link :
                    <input name="Link" type="text" id="Link" value='<%# DataSet1.FieldValue("Link", Container) %>' size="62"></td>
                </tr>
              </table>
              <table width="433" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="145">Starting Price :
                    <input name="StartPrice" type="text" id="StartPrice" value='<%# Double.Parse(DataSet1.FieldValue("StartingPrice", Container)).ToString("C") %>' size="15"></td>
                  <td width="137">Reserve Price :
                    <input name="Reserve" type="text" id="Reserve" value='<%# Double.Parse(DataSet1.FieldValue("ReservePrice", Container)).ToString("C") %>' size="15"></td>
                  <td width="151">Listing Price :
                    <input name="ListPrice" type="text" id="ListPrice" value='<%# Double.Parse(DataSet1.FieldValue("ListingPrice", Container)).ToString("C") %>' size="15"></td>
                </tr>
              </table>
              <table width="433" border="0" cellspacing="0" cellpadding="2">
                <tr>
                  <td width="66" valign="top">Payment :</td>
                  <td width="182"><select name="Payment" size="5" multiple id="Payment" title='<%# DataSet1.FieldValue("Payment", Container) %>'>
                    <option>PayPal</option>
                    <option>Credit Card</option>
                    <option>Money Order</option>
                    <option>Escrow</option>
                    <option>Personal or Cashier's Checks</option>
                    <option>Bank to Bank Transfer</option>
                    <option>Instant Cash Wire Transfer</option>
                  </select></td>
                  <td width="173">(Hold Ctrl and click to select more than one) </td>
                </tr>
              </table>
              <table width="433" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="197">Day Started :
                    <input name="StartDate" type="text" id="StartDate" value='<%# DateTime.Parse(DataSet1.FieldValue("DateStarted", Container)).ToString("d") %>'></td>
                  <td width="57">&nbsp;</td>
                  <td width="179">Days Last :
                    <input name="Days" type="text" id="Days" value='<%# DataSet1.FieldValue("DaysLast", Container) %>'></td>
                </tr>
              </table>
              <table width="433" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="197">Sale Price :
                    <input name="SoldPrice" type="text" id="SoldPrice" value='<%# Double.Parse(DataSet1.FieldValue("SellingPrice", Container)).ToString("C") %>'></td>
                  <td width="57">&nbsp;</td>
                  <td width="179">Ebay Price :
                    <input name="EbayPrice" type="text" id="EbayPrice" value='<%# Double.Parse(DataSet1.FieldValue("EBaySellingPrice", Container)).ToString("C") %>'></td>
                </tr>
              </table>
              <table width="433" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td><%# DataSet1.FieldValue("UserName", Container) %>&nbsp;</td>
                  <td align="center"><input type="submit" name="Submit" value="Edit Tracker Now!">                    
                  <label id="Date"></label>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                  </tr>
              </table>
                    </center>
                    
             
              <br>
                    
                        </div></td>
          </tr>
        </table>
...
<input type="hidden" name="MM_update" value="form1">
</form>
Avatar of CoolATIGuy
CoolATIGuy

So you are saying that when you fill out the form (admin page) and click edit, it reloads the form again (still admin page)?  I do some php, not asp...

What is runat='server'?  Is that the way asp posts back to itself, like php posting to the server?

Also, is this correct:

'<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_ebaytrackerdatabase"] %>'


Did you make sure that connection still exists?  That could be your prob...


CoolATIGuy
Avatar of zeurx

ASKER

runat tells the server to compile the code i think
the other one dw made so it sould be right
and i have a manage.aspx and a edit.aspx and a trackercore.aspx that allows session only access to the edit page.... compairs user to filtered selected list and says if it can or cannot be edited via same user auth
Avatar of zeurx

ASKER

users can post but only admins can edit....

user
-----
- post
but cant update

admin
--------
- post
- edit
adminedit.aspx
works like a charm
Avatar of zeurx

ASKER

ummmmmmmm
........................
it works now :O
and i dont know what i did

will split points
Avatar of zeurx

ASKER

edit to last one will give points to only one person  (shake my head in stupidity)
LOL...maybe your hoster was having a bit of trouble?  Or you got caught in the anomaly that we webmasters occasionally get trapped in, where stuff just doesn't work, through no fault of our own. :-)  Or, most possibly, I actually had a dead-on answer that fixed the problem (even though it didn't).


CoolATIGuy
Avatar of zeurx

ASKER

ummmm i found it was my method of security.... i took it out and works grate but when its in i guess im lucky it worked