[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

update database

Posted on 2004-11-30
11
Medium Priority
?
182 Views
Last Modified: 2010-04-25
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
0
Comment
Question by:zeurx
  • 8
  • 3
11 Comments
 
LVL 8

Accepted Solution

by:
CoolATIGuy earned 228 total points
ID: 12712009
Well, I don't think DWMX2004 would have changed your ASP.NET code...sounds like you need to double check and make sure that your database update stuff is setup correctly before it does it's header() or whatever to redirect back to the admin page.

Can you post some code, please...


CoolATIGuy
0
 

Author Comment

by:zeurx
ID: 12712038
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
0
 

Author Comment

by:zeurx
ID: 12712047
when i click the button it goes right back to the edit page when i take my security out and i dont know y
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 

Author Comment

by:zeurx
ID: 12712089
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>
0
 
LVL 8

Expert Comment

by:CoolATIGuy
ID: 12712239
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
0
 

Author Comment

by:zeurx
ID: 12712419
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
0
 

Author Comment

by:zeurx
ID: 12712445
users can post but only admins can edit....

user
-----
- post
but cant update

admin
--------
- post
- edit
adminedit.aspx
works like a charm
0
 

Author Comment

by:zeurx
ID: 12712483
ummmmmmmm
........................
it works now :O
and i dont know what i did

will split points
0
 

Author Comment

by:zeurx
ID: 12712495
edit to last one will give points to only one person  (shake my head in stupidity)
0
 
LVL 8

Expert Comment

by:CoolATIGuy
ID: 12712846
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
0
 

Author Comment

by:zeurx
ID: 12712954
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
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Screencast - Getting to Know the Pipeline
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question