updating database on edit page after edit values in textbox field

Hi all

I am having a view page with feilds like userid, username, email,and etc.....All controls are Textboxes.....All controls are disabled at view page...Data comes from database, on the bases of userlogin details...User can only view the filled by him/her during registration....I have one LinkButtion named "Edit Profile" on view page....As user clicked to Edit Profile...all controls get enabled except userid...now as user edit the details and click on save button data should get updated in the database with resoect to userid....And the problem is update query not getting the edited value of the textbox...

For example...

Username was "Jackson"

User edit the detail of username as "Jackson Mack"

But in update query the of username is coming as "Jackson" not "Jackson Mack".....I m not getting why it is not taking "Jackson MacK" edited value....Value is editted in Textbox Control

Please help me to find this....

Nick


Regards Nick,

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

If this solution doesn't solve your problem, just feel free to mark it as not answer and reply.
0
nickgenius
1/29/2008 6:54:42 AM
asp.net.object-datasource 16182 articles. 0 followers. Follow

5 Replies
726 Views

Similar Articles

[PageSpeed] 23

Could you post your code for us please? 


Please mark posts as the answer if I was helpful. Thanks!

Visit my blog
0
ParrotBoy
1/29/2008 9:17:34 AM

Suppose to fill  the data into textboxes you are using a method called filldata in page load event.Then use

if (!IsPostBack)

{

filldata ();

}

 

 

0
bhanupochampally
1/29/2008 9:21:31 AM

Hi nickgenius,

I think your problem is not too difficult to solve. However, since you use text boxes as the display control, the process could be a little troublesome. What kind of database do you have ? If it's a sql datasource, I would like to suggest you follow this:

First, make sure your sqldatasource has a update command. A typical update command is like this: Update tbl set userid=@uid, email=@email, age=@age where user=@user

and second, you need to add some update parameters like this:

            <UpdateParameters>
                <asp:ControlParameter ControlID="TextBox1" DefaultValue="" Name="uid" PropertyName="Text" />
                <asp:ControlParameter ControlID="TextBox2" DefaultValue="" Name="email" PropertyName="Text" />
                <asp:ControlParameter ControlID="TextBox3" DefaultValue="" Name="age" PropertyName="Text" />
            </UpdateParameters>

And finally, you can set a button control in someplace of your page, and in that button control eventhandler, you call your sqldatasource.Update() method.

More information, take a look at this: http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasource.update.aspx

Hope my suggestion helps


Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
0
Bo
1/31/2008 8:19:01 AM

Hi,

thanks for ur help...but it doesnot work....


Regards Nick,

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

If this solution doesn't solve your problem, just feel free to mark it as not answer and reply.
0
nickgenius
2/1/2008 8:32:38 AM

I used code under ( ! IsPostback ) and here it goes.........zooooooooooommmmmmmm

It works under that...I got it

Cheers

Nick


Regards Nick,

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

If this solution doesn't solve your problem, just feel free to mark it as not answer and reply.
0
nickgenius
2/1/2008 9:25:12 AM
Reply:

Similar Artilces:

Trying to edit web form, can't get database updated with newly edited values.
 This is my code:  when I try to update any of the fields, the update statement retains the old values retrieved from the database.  Could you tell me where my code is bad? -Thanks, Mark   <%@ Page Language="VB" %><%@Import Namespace="System.Data"%><%@Import Namespace="System.Data.SqlClient"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> Protected Sub Page_Load(ByVa...

Displaying Information in textboxes to edit and send back to the object to update the database.
 ASP.NET 2.0 using VB.NET 2005 codebehind I know how to create a new dog owner...but now what I want to do is display the data of the information I just inserted.  Is there a way i can hard code the GUID for now until i have the Login Authentication setup up to display or recognized that a new dog owner account needs to be created?  If you have code samples of both please assist and also, what would I need to do with my code in order to display an account that already exist.  My Page_Load code follows:  I'm new to this and I'm just learning as I go in order to u...

FormView with ObjectDataSource
I have a Formview to display a subset of the fields of a business object. When I  update using the formview I am only allowing the user to edit a couple fields. When the update happens it only saves the "editable" fields to the database? It does not retain any of the original values that the object contained when it was first pulled from the database. Anyone have any ideas? I would think the way it would work would be to populate the original object...change the values that are editable and save the object back. Here is the code for the objectdatasource:<asp:ObjectDataSource ID="odsM...

To edit or no to edit
Jon, Can I edit, whatever I've written so far, so that it doesn't look like I wrote utterly crap?-) -- Pieter "Linux is like living in a teepee. No Windows, no Gates, Apache in house." -- Usenet signature Pieter Zijlstra wrote: > Jon, > > Can I edit, whatever I've written so far, so that it doesn't look like > I wrote utterly crap?-) Oh boy, the edit button vanished from the web-forum ... ;-) -- Pieter "Humor is also a way of saying something serious." -- T. S. Eliot (1888 - 1965) Pieter Zijlstra wrote: ...

Editable/Not Editable
Hello All, I have some webform(.aspx page) in which i have some controls (for input) and i would like to make that screen editable/not editable based on some condition. how can i do that.  the whole intent is user can read the information but can't change.  shiva kumar If you want to make the controls editable/non-editable, you can set their ReadOnly property to true or false accordingly. What exactly do you imply by making the screen editable/non-editable?Thanks,MaxLet Me Google That For You! i mean to say i would like to show the current values but user should not mod...

How to edit a value in the gridview and update it to the database
I have been searching online but I can't find anything useful and for the most part, they are all in C# which I don't know how to use, I am using VB coding. I have a gridview and when I added a column with values, it works fine.  I go and add the column that is called Edit, Update, Cancel.  And when I run the program and click on Edit I get the error below, I don't know what code I need inside the vb in order for me to get this working. [HttpException (0x80004005): The GridView 'gvwOrders' fired event RowEditing which wasn't handled.] System.Web.UI.We...

trying to save editted textbox value in table but original value saves instead
This program gets the values of A and B passed in. They are for table columns DXID and CODE. The textbox GET1 is initialized to B when the page is loaded. When I type another value in GET1 and try to save it, the original initialized value gets saved and not the new value I just typed in. A literal value, like "222" saves but the new GET1.TEXT doesn't. Why is this?How do I make this work right?<%@ page language="vb" %><%@ reference page="try7.aspx" %><% @import namespace="system...

Edit but no edit
I've Created a custom module and reuse the survey.dnn file to help with the install here it is. <?xml version="1.0" encoding="utf-8" ?> <dotnetnuke version="2.0" type="Module"> <folders> <folder> <name>CompanyName - Photos</name> <description>Photos allows you to add photo albums</description> <version>01.00.00</version> <modules> <module> <friendlyname>CompanyName - Photos</friendlyname> <controls> <c...

edit value in linq datasource updating event
hi,  I am using linq data source and Form View to allow users insert/edit their records on products.I would like Users not able to edit some fields (read only) but I could edit value for these fields in code behind .Suppose I would not like users to add/edit products but they could not select "category" for products table -Norhtwind DB-  and I could assign category base on user membership role.. Could you please tell me how could I do it while using linq data source?And also which event should I use?   Smith you can do this by trapping the datasource Inser...

update db w/value from textbox after edit
Hello again, so I have a html table with some textboxes in it. they are populated by a datareader. they are not readonly so you can edit them. underneath I have a button "update" which calls Private Sub updatebutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles updatebutton.Click Dim strlastname As String = txtlastname.Text Dim strSQL As String = "UPDATE tblcust SET namelast = '" & strlastname & "' where namelast = '" & strResult & "'" Dim objcmd As New SqlComman...

Need to make edit properties for the update text boxes in editable gridveiw fields.
I have a gridview with AutoGenerateEditButtons set to true.  My problem is i don't know  how to edit the width or the maxlength of the update text boxes inside the gridview that are automatically generated when the user hits edit. Thanks for any help on this. You can specify the width of edit fields by applying control styling:<Columns>     <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" ControlStyle-Width="500px">    </asp:BoundField> </Columns>  Or you could look into using t...

Edit Page / HTML editing
Use the Edit Page and HTML editing daily. Thanks for continuing to improve it. Thank you for this tool!!!!!!! Greg Connell wrote, On 18/12/2013 06:52: > Use the Edit Page and HTML editing daily. > > Thanks for continuing to improve it. > > Thank you for this tool!!!!!!! If you speak about the SM Composer ... nobody improve this tool. Ray_Net wrote: > Greg Connell wrote, On 18/12/2013 06:52: >> Use the Edit Page and HTML editing daily. >> >> Thanks for continuing to improve it. >> >> Thank you for this tool!!!!!!! > If yo...

edit data in details view- is it possible to make a field a drop down instead of a textbox when editing?
Hi all I have been using the details view and i have a page where a user can edit their details. The only problem is that one of the fields is a status code. This status code is set to 0=working,1= pending,2 = cancelled and these 3 codes are stored in a StatusCodeDetails table in the database.   I dont want users to be able to have to type 0,1 or 2 when they are updating peoples status. Is there any way I can get the status code to become a drop down with 0,1,2 as the options?   Thanks d...

Edit a Database Field when Checkboxed Value on Submit Click
 Hi,  I am new to VWD and VB, and I have been racking my brain for weeks on how to do this.  My main problem is I don't even know what I am looking for.  Am I looking for a VB script?  ASP script VB code?  No clue!  Anyway, here is my question.  The ASP page below displays a GridView with a custom column I made for a checkbox.  When the submit button is clicked it runs the script at the top of the code and iterates through each row (or so I think) and checks for a checked box then, on line 20 I would like to update the Runner field of the selecte...

Web resources about - updating database on edit page after edit values in textbox field - asp.net.object-datasource

Wikipedia:Updating information - Wikipedia, the free encyclopedia
This page documents an English Wikipedia editing guideline . It is a generally accepted standard that editors should attempt to follow, though ...

Facebook Updating Software Development Kit For Apple IOS 6 To Reflect Integration
With Facebook integration officially coming to Apple’s iOS 6 mobile operating system for its iPhone and iPad tablet, what new features are in ...

Updating how Cost per Click is Measured on Facebook
To help advertisers better understand how their ads perform, we're updating the definition of cost per click on Facebook. Learn what the change ...

Updating Your App for iOS 9: What You Need to Know
Updating Your App for iOS 9: What You Need to Know

Facebook for iPhone 3.0 to Include Page Updating
... who want to more easily update their Facebook Pages on the go: Facebook for iPhone 3.0 , which should be released soon, will include Page updating, ...

Updating trends on mobile
Trends are a great way to find out what people are talking about on Twitter at a given moment and at a single glance. Starting today, we’re making ...

Delhi Metro Fare Calculator and Auto-Updating Map on the App Store on iTunes
Get Delhi Metro Fare Calculator and Auto-Updating Map on the App Store. See screenshots and ratings, and read customer reviews.

BlackBerry Bold 9000 Updating #2 - Flickr - Photo Sharing!
Explore berrytokyo's photos on Flickr. berrytokyo has uploaded 126 photos to Flickr.

Freeview launches auto-updating EPG
Shows running late won't phase new Freeview PVRs, but the new Australian EPG doesn't work with all Freeview gear.

Tips For Updating Your Appearance
Like Joe Hockey, all men can pull off a radical mid-life makover by following some simple guidelines.

Resources last updated: 11/21/2015 10:58:50 PM