zeurx
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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.Confi gurationSe ttings.App Settings[" MM_CONNECT ION_STRING _ebaytrack erdatabase "] %>'
DatabaseType='<%# System.Configuration.Confi gurationSe ttings.App Settings[" MM_CONNECT ION_DATABA SETYPE_eba ytrackerda tabase"] %>'
Expression='<%# Request.Form["MM_update"] == "form1" %>'
CreateDataSet="false"
Debug="true"
><Parameters>
<Parameter Name="@DaysLast" Value='<%# ((Request.Form["Days"] != null) && (Request.Form["Days"].Leng th > 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"].Leng th > 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"].L ength > 0)) ? Request.Form["Payment"] : "" %>' Type="WChar" />
<Parameter Name="@ReservePrice" Value='<%# ((Request.Form["Reserve"] != null) && (Request.Form["Reserve"].L ength > 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"].Le ngth > 0)) ? Request.Form["ItemID"] : "" %>' Type="WChar" />
<Parameter Name="@DateStarted" Value='<%# ((Request.Form["ItemID"] != null) && (Request.Form["ItemID"].Le ngth > 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("Track Name", Container) %>' width="114"></td>
<td width="63"></td>
<td class="style5">Item ID :
<input name="ItemID" type="text" id="ItemID" value='<%# Double.Parse(DataSet1.Fiel dValue("Tr ackNumber" , 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.Fiel dValue("St artingPric e", Container)).ToString("C") %>' size="15"></td>
<td width="137">Reserve Price :
<input name="Reserve" type="text" id="Reserve" value='<%# Double.Parse(DataSet1.Fiel dValue("Re servePrice ", Container)).ToString("C") %>' size="15"></td>
<td width="151">Listing Price :
<input name="ListPrice" type="text" id="ListPrice" value='<%# Double.Parse(DataSet1.Fiel dValue("Li stingPrice ", 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("Payme nt", 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.Fi eldValue(" DateStarte d", Container)).ToString("d") %>'></td>
<td width="57"> </td>
<td width="179">Days Last :
<input name="Days" type="text" id="Days" value='<%# DataSet1.FieldValue("DaysL ast", 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.Fiel dValue("Se llingPrice ", Container)).ToString("C") %>'></td>
<td width="57"> </td>
<td width="179">Ebay Price :
<input name="EbayPrice" type="text" id="EbayPrice" value='<%# Double.Parse(DataSet1.Fiel dValue("EB aySellingP rice", Container)).ToString("C") %>'></td>
</tr>
</table>
<table width="433" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><%# DataSet1.FieldValue("UserN ame", Container) %> </td>
<td align="center"><input type="submit" name="Submit" value="Edit Tracker Now!">
<label id="Date"></label>
&n bsp; </td>
</tr>
</table>
</center>
<br>
</div></td>
</tr>
</table>
...
<input type="hidden" name="MM_update" value="form1">
</form>
<MM:Update
runat="server"
CommandText='<%# "UPDATE Main SET DaysLast=?, EBaySellingPrice=?, Link=?, ListingPrice=?, Payment=?, ReservePrice=?, SellingPrice=?, StartingPrice=?, TrackName=? WHERE TrackNumber=? AND DateStarted=?" %>'
ConnectionString='<%# System.Configuration.Confi
DatabaseType='<%# System.Configuration.Confi
Expression='<%# Request.Form["MM_update"] == "form1" %>'
CreateDataSet="false"
Debug="true"
><Parameters>
<Parameter Name="@DaysLast" Value='<%# ((Request.Form["Days"] != null) && (Request.Form["Days"].Leng
<Parameter Name="@EBaySellingPrice" Value='<%# ((Request.Form["EbayPrice"
<Parameter Name="@Link" Value='<%# ((Request.Form["Link"] != null) && (Request.Form["Link"].Leng
<Parameter Name="@ListingPrice" Value='<%# ((Request.Form["ListPrice"
<Parameter Name="@Payment" Value='<%# ((Request.Form["Payment"] != null) && (Request.Form["Payment"].L
<Parameter Name="@ReservePrice" Value='<%# ((Request.Form["Reserve"] != null) && (Request.Form["Reserve"].L
<Parameter Name="@SellingPrice" Value='<%# ((Request.Form["SoldPrice"
<Parameter Name="@StartingPrice" Value='<%# ((Request.Form["StartPrice
<Parameter Name="@TrackName" Value='<%# ((Request.Form["ItemName"]
<Parameter Name="@TrackNumber" Value='<%# ((Request.Form["ItemID"] != null) && (Request.Form["ItemID"].Le
<Parameter Name="@DateStarted" Value='<%# ((Request.Form["ItemID"] != null) && (Request.Form["ItemID"].Le
</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("Track
<td width="63"></td>
<td class="style5">Item ID :
<input name="ItemID" type="text" id="ItemID" value='<%# Double.Parse(DataSet1.Fiel
</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"
</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.Fiel
<td width="137">Reserve Price :
<input name="Reserve" type="text" id="Reserve" value='<%# Double.Parse(DataSet1.Fiel
<td width="151">Listing Price :
<input name="ListPrice" type="text" id="ListPrice" value='<%# Double.Parse(DataSet1.Fiel
</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("Payme
<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.Fi
<td width="57"> </td>
<td width="179">Days Last :
<input name="Days" type="text" id="Days" value='<%# DataSet1.FieldValue("DaysL
</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.Fiel
<td width="57"> </td>
<td width="179">Ebay Price :
<input name="EbayPrice" type="text" id="EbayPrice" value='<%# Double.Parse(DataSet1.Fiel
</tr>
</table>
<table width="433" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><%# DataSet1.FieldValue("UserN
<td align="center"><input type="submit" name="Submit" value="Edit Tracker Now!">
<label id="Date"></label>
&n
</tr>
</table>
</center>
<br>
</div></td>
</tr>
</table>
...
<input type="hidden" name="MM_update" value="form1">
</form>
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.Confi gurationSe ttings.App Settings[" MM_CONNECT ION_STRING _ebaytrack erdatabase "] %>'
Did you make sure that connection still exists? That could be your prob...
CoolATIGuy
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.Confi
Did you make sure that connection still exists? That could be your prob...
CoolATIGuy
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
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
ASKER
users can post but only admins can edit....
user
-----
- post
but cant update
admin
--------
- post
- edit
adminedit.aspx
works like a charm
user
-----
- post
but cant update
admin
--------
- post
- edit
adminedit.aspx
works like a charm
ASKER
ummmmmmmm
........................
it works now :O
and i dont know what i did
will split points
........................
it works now :O
and i dont know what i did
will split points
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
CoolATIGuy
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
ASKER