.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
satyapriyanayak
SP
abhays
Sasi Prabhu
Post New Web Links

How to update data in EditItemTemplate?

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :ASP.Net
 
Hi All,I have a asp:DetailsView that is binded to a linqdatasource and AutoGenerateColumn="False" EnableEditting="True"then I add a TemplateField to this DetailsView:<asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="LinqDataSource2" AutoGenerateRows="False" > <Fields> <asp:TemplateField> <ItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%#Eval("fName") %>' Enabled="False" /> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%#Eval("fName") %>' /> </EditItemTemplate> </asp:TemplateField> <asp:CommandField /> </Fields> </asp:DetailsView>when I hit the "Edit" link the textbox enabled is true and I am able to change the text, but after I hit the "


View Complete Post


More Related Resource Links

SQL Server CE: New Version Lets You Store and Update Data on Handheld Devices

  

Handheld device users need to be able to synchronize with a main data store when it's convenient and, preferably, when the back-end database server isn't busy. SQL Server 2000 Windows CE Edition allows you to build a traveling data store that can be displayed and run on a variety of devices. SQL Server CE supports a subset of the full SQL Server package, and can be used as a standalone server or in tandem with SWL Server and IIS. The architecture of SQL Server CE, along with data manipulation, synchronization, and connectivity issues, are discussed in this article. Topics such as making your data public, choosing the right type of replication, and handling errors are also covered.

Paul Yao and David Durant

MSDN Magazine June 2001


Transferring data (on update) from SQL to SLQL (2008

  
Hi there,   we are having 2 MS SQL 2008 servers, where the first one is our main machine where our ERP (Navision) is running on. Now, due to a customer request, I need to send data from our main sql server into our second sql server. But not everything, only some specific datasets (only if the specific customer is affected)... not only on inserts, but also on updates and on multiple tables.   I am not quite sure which technology to use for that, I tried to read something about Integration Services and Trigger, but as I am not really into both of them and not sure what technique would be the most suitable, I'd like to ask the experts here for some advice.   The affected rows might be around 2-10% of our total inserts / updates a day.   Any help would be appreciated!

Update XML data in SQL

  
Is there an easy quick way to update an xml value based on the contents of that value....? From my research so far this seems to be much more involved then I expected it to be. Here is my table CREATE TABLE [dbo].[ReportJobs]( [ReportJobId] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL, [Enabled] [bit] NOT NULL, [Description] [nvarchar](500) NOT NULL, [ReportDefId] [int] NOT NULL, [Email] [nvarchar](500) NULL, [LastRunResult] [nvarchar](50) NULL, [ScheduleId] [int] NOT NULL, [LastRun] [datetime] NULL, [NextRun] [datetime] NULL, [PersonId] [int] NULL, [Parameters] [xml] NOT NULL, Here is an example of the xml contained in Parameters for one record. <ReportParams> <Param Name="EntityID">103</Param> <Param Name="RelDateFromNum">-3</Param> <Param Name="RelDateFromWhich">Day(s)</Param> <Param Name="RelDateToNum">0</Param> <Param Name="RelDateToWhich">Day(s)</Param> <Param Name="GeoID">288</Param> <Param Name="InboundFlag">False</Param> <Param Name="ShowTimeliness">True</Param> </ReportParams>  Here is what I'm trying to do.... What is the correct way to make the following statement? Update ReportJobs set <ReportParams/GeoID> = 12 w

update data on table

  
i have  100000 record  found in the  tha table and  i want  to update the column SocialState when found male he replace  the text male to 1 and when foun Female  he replace the text to 2   update [Drugs].[db_accessadmin].[Data] set SocialState='1' where SocialState='Male' update [Drugs].[db_accessadmin].[Data] set SocialState='2' where SocialState='FeMale' he give me this message "(0 row(s) affected)"

Sys.Data.DataContext.saveChanges method doesn't send update to server after DataServiceException ex

  
Hello,I have a page with a simple form that updates a single record in a table in my database.The database is accessed via WCF Data Services. To load and save data from/to the server, I usethe Sys.Data.DataContext object provided by the ASP.NET AJAX library. When the "save" button on theform is clicked, I use the saveChanges method of the Sys.Data.DataContext object to send all changes to the server.Also, at the server side, I use an interceptor that checks the "Price" fields of the record, and throws a DataServiceException exception when the contents of the field is a negative number.Both the JavaScript and the interceptor (in C#) are copied below.Here is the interesting thing:When I enter a negative price in the form, the interceptor throws the exception and my form shows an error message. Good.However, if I then make one of the other fields in the form a bit shorter (for example from "abcd" to "abc"),the saveChanges method doesn't send the data to the server. But it does call the success callback that I passed in to saveChanges, creating the impressionthat the data has been saved. This happens while the Price field is still negative. I used Fiddler to make sure thatno message is sent to the server. Also, the interceptor doesn't get executed.The weird thing is that if I make one of the fields a bit longer instead (for example &q

Invalid data has been used to update the list Item.(List definition)

  
<nativehr>0x80070057</nativehr><nativestack></nativestack>Invalid data has been used to update the list item. The field you are trying to update may be read only. I have created a list definition and into that i have created lookup column when i am trying to add any item into the list then it gives me an error as above. Can anyone help me.? I made the readonly attributes to false for lookup columns.  

Invalid data has been used to update the list item in sharepoint 2010.

  
I have created a custom list definition with one lookup field <      Field ID="{865CD714-7DF6-4F65-9DBC-5FE910B10BC5}" Name="CompanyName" DisplayName="Company Name" Group="Custom contents" Description="Select Company" Type="Lookup" ShowField="CompanyName" Required="FALSE" FieldRef="CompanyName" List="Lists/LookupListDefinition-ListInstance1" ReadOnly="FALSE"></Field>   <nativehr>0x80070057</nativehr><nativestack></nativestack>Invalid data has been used to update the list item. The field you are trying to update may be read only. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. My solution is perfectly get deployed on site. I can see the list instance created on site its also appears on quicklaunch. When i am trying to add the item into the custom list using UI then i am getting the input form correctly i can see the lookup values in dropdown list but when i click on save button then its give me an error as mention above. For debugging purpose i have created the event reciver class for list item adding event. In that i have check the column status and

jQuery & WCF Data Service - PUT Update - Rejected with 405 Method Not Allowed

  
I am writing a sample jQuery/WCF Data Service app to utilize OData, however I am getting a status code 405 - Method not allowed when I attempt to update an entity with a PUT Http method. I have configured my WCF Data Service as follows: public static void InitializeService(DataServiceConfiguration config) { config.SetEntitySetAccessRule("jCredentials_PINs", EntitySetRights.All); config.SetEntitySetAccessRule("jCredentials_PINTree", EntitySetRights.All); //config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All); config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2; } I am attempting to update the jCredentials_PINs table. My jQuery call to update the WCF Data Service is as follows:function UpdatePIN(selectedTreeNode, updateObj) { var url = dataService + "/jCredentials_PINs(guid'" + selectedTreeNode.get_value() + "')"; var json = JSON.stringify(updateObj); $.ajax({ url: url, data: json, type: "PUT", contentType: "application/json; charset=utf-8", timeout: 10000, dataType: "json", success: AjaxPINUpdateSuccess, error: AjaxPINUpdateFailure }); } function AjaxPINUpdateSu

Re-indexing or update statistics after purging data

  
All,   I’m purging 250GB from a 1TB Multi SQL server databases in one weekend.   After running a re-indexing job do I have to run update statistics?   It takes about 5 hours to run 5% stats, so it will take a loooong time to do 100%.   I have been told that I don’t need to run update stats if I ran Re-Indexing, What do you think?

Re-index or update statistics after purging data

  
All,   I’m purging 250GB from a 1TB Multi SQL server databases in one weekend.   After running a re-indexing job do I have to run update statistics?   It takes about 5 hours to run 5% stats, so it will take a loooong time to do 100%.   I have been told that I don’t need to run update stats if I ran Re-Indexing, What do you think?

Update one column of a table with data from another table

  
I have two tables which are different with the exception of a single field (column name = "LocationCode"). Both tables can also be joined with a common id field. I would like to update the "LocationCode" values in one table with the the "LocationCode" of the other table. I can do a relational join on the common id. It is impractical for me to update one row at a time. How can I update all the rows quickly?   But one more point both tables lies in different database Varinder Sandhu http://varindersandhus.blogspot.com/

Update one column of a table with data from another table

  

I have two tables which are different with the exception of a single field (column name = "LocationCode").

Both tables can also be joined with a common id field.

I would like to update the "LocationCode" values in one table with the the "LocationCode" of the other table. I can do a relational join on the common id.

It is impractical for me to update one row at a time. How can I update all the rows quickly?

 

But one more point both tables lies in different database


Varinder Sandhu http://varindersandhus.blogspot.com/

unable to update data to databse from grid view

  

I have two tables in my database

using "innerconnect" i have show table content in grid view as      INV_NO            INV_DT        DN_NO       DN_DT   LR_NO        LR_DT .

where LR_NO is null .

I want to update it from grid view plz help




TABLES









here  DN_NO  and INV_NO are primary keys

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace amar
{
    public partial class Form2 : Form
    {
        SqlConnection con;
        SqlDataAdapter da1,da2;
        SqlCommandBuilder cb;
    &nb

Insert/Update data to multiple tables on a single button click

  

Hi experts,

I need to insert/update data to 3 or more tables on a single button click.What is best method for achieving this?I am using mysql as my DB.

Thanks for your valuable reply in advance.


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend