UpdateParameters

Please support our ASP.NET advertiser: $6.99 Domain Names at 1&1. Includes Free Privacy. Save Now!
Reply

Join Date: Jul 2008
Posts: 46
Reputation: robertmacedonia is an unknown quantity at this point 
Solved Threads: 0
robertmacedonia robertmacedonia is offline Offline
Light Poster

UpdateParameters

 
0
  #1
May 9th, 2009
Hi, I have this little application in ASP.NET, written in C#, it's about keeping simple information about clients, so I have the user enter info, and then, another page when he or she can update the information, particularly the address. So I have a textbox where the new information is entered, and the this button, and this is the code in the button - click event.

  1. protected void PromeniButton_Click(object sender, EventArgs e)
  2. {
  3. SqlDataSource1.UpdateParameters["Adresa"].DefaultValue = NovaAdresaTextBox.Text;
  4. SqlDataSource1.Update();
  5.  
  6. Response.Redirect("~/Meni.aspx");
  7. }

And yet, when this is done, nothing is changed in the database, the address is still the same. I do not know what the problem might be, so would you please help me. Regards.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 3,793
Reputation: sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of 
Solved Threads: 698
Sponsor
Featured Poster
sknake's Avatar
sknake sknake is offline Offline
.NET Enthusiast

Re: UpdateParameters

 
0
  #2
May 11th, 2009
  1. SqlDataSource1.UpdateParameters["Adresa"].DefaultValue = NovaAdresaTextBox.Text;

That code is setting the default value used in the update queries' parameters. SqlDataSource should expose a View for the table in question. I don't use SqlDataSource but look around, you should be able to:

  1. SqlDataSource["TableName"][rowIndex].Field = value;
  2. SqlDataSource["TableName"].Save();

If you hadn't had any luck by morning i'll get the exact syntax.
Scott Knake
Custom Software Development
Apex Software, Inc.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1192 | Replies: 1
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC