| | |
UpdateParameters
![]() |
•
•
Join Date: Jul 2008
Posts: 46
Reputation:
Solved Threads: 0
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.
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.
c# Syntax (Toggle Plain Text)
protected void PromeniButton_Click(object sender, EventArgs e) { SqlDataSource1.UpdateParameters["Adresa"].DefaultValue = NovaAdresaTextBox.Text; SqlDataSource1.Update(); Response.Redirect("~/Meni.aspx"); }
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.
ASP.NET Syntax (Toggle Plain Text)
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:
ASP.NET Syntax (Toggle Plain Text)
SqlDataSource["TableName"][rowIndex].Field = value; SqlDataSource["TableName"].Save();
If you hadn't had any luck by morning i'll get the exact syntax.
![]() |
Similar Threads
- Populate dropdownlist in formview (ASP.NET)
- Must Declare Scalar Variable? (ASP.NET)
- How do i get a datagrid to update & delete rows. (ASP.NET)
- GridView Fields Visible (ASP.NET)
- object datasource can not find generic method (ASP.NET)
- Hide Table rows in FormView InsertTemplate (ASP.NET)
- delete command does not work (ASP.NET)
- need help with sql database in asp.net using VB (ASP.NET)
- Problem Updating Row in GridView (ASP.NET)
- UpdateCommand does not work (MS SQL)
Other Threads in the ASP.NET Forum
- Previous Thread: Visual Studio 2005 - Credentials for Remote Site Login
- Next Thread: MaximumAutomaticRedirections Question
Views: 1192 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 activexcontrol ajax ajax-doc asp asp.net asp.net-books asp.net-mvc asp.net-security authentication bc30451 browser businesslogiclayer button c# chat checkbox child click commonfunctions complex connection connectionstring control database datagridview datagridviewcheckbox datalist deadlock deployment development dgv directshow domain dynamic edit event-bubble-up feedback fileuploader flash form form-authentication forms gridview hosting iframe iis iis-appmapping impersonation india javascript json list locahost-email localhost login mysql opera panel pdf problem profile programming project purchase question radio redirect request.form response.redirect result richtext richtextbox role search server session sharepoint silverlight software sql sql-server textbox trust-level typeof update url validation vb vb.net vista visualstudio web webarchitecture website windows-auth xml xsl






