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


Post New Web Links

using data in a gridview to update a table

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :ASP.Net
 

Hi,

I have a gridview that gathers data from two tables, an orders table and a products table. I have an OrderQuantity from the Orders table and a StockQuantity from the Products table and a button to process the order.

I am trying to move through the GridView one line at the time, substract the OrderQuantity from the StockQuantity and update the Product table.

How do I move through the GridView?

Cheers


Ellie





View Complete Post


More Related Resource Links

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)"

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/

pull some data from a table twice for same gridview

  

 Hello all - I have been searching google for a solution to this problem but I'm having difficulty describing it in keywords.

environment:  VWD 2010 Express, VB, SQL Express, .NET 4.0

I have a gridview that currently pulls data from a table called CrossRef which has the ID numbers of tasks that need to go in a certain sequence.  So the gridview looks like:

Task 1       Sequence          Task 2           XRefID

10               BEFORE             22                 4

2                AFTER                6                  5

17              BEFORE              2        

Save/Update/Delete Sql Server data base table using Sharepoint Designer

  

Can some one help me to achieve below task

Save/Update/Delete Sql Server data base table using Sharepoint Designer.


How to Refresh Gridview data from update panel in specified time

  

hello frnds,

i have some search criteria.

after filling all criteria when i press search button the result arrives in gridview nw when searchbutton pressed after that every 20seconds i want 2 update gridview data which is in update panel



How to INSERT GridView data into another table (besides the one it is bound to)??

  

Hi All,

I have a tricky situation that I just cannot seem to figure out.  I'm using ASP.NET 4.0.  I have two databases (let's call them Northwind and MyDatabase for simplicity).  I cannot modify the data in Northwind, but once I save a copy to MyDatabase, I can change it.

I have a GridView that shows all the tests associated with a patient.  I first populate the GridView, retrieving all the tests in Northwind.Test that are associated to a PatientID.  On a button click event, I need to:

  1. Create a new Patient record in MyDatabase.Patient (I've got this part done already).
  2. Use that newly created PatientID and INSERT all of the rows from the GridView into MyDatabase.Test.  I have the PatientID available, I just don't know how to retrieve the data from the GridView.
  3. (Ideally) I would like to then be able to load that patient record in the future from MyDatabase and be able to UPDATE the tests in the GridView to MyDatabase.Test.

I can load the tests into the GridView no problem.  But I have no idea how I would save that data to a different datasource.  Any ideas?  Should I even be using a GridView, or something else?


-Thanks in advance-


SQL Update and Insert: Inserting a whole data table into another table

  

Hello,

If I create a data tabe in C# like so:

datatable t = new DataTable;

DataColum C1 = new DataColum;//ID column

t.Columns.Add(C1);

//the same with column C2

Then I fill up the table with some data.

Then the goal is to either insert this data or update data in an SQLtable in SQL. If the data is inserted, the ID column in t would be empty, if updated, it would not be. So in the insertion case, the sql query needs to make sure that unique IDs are assigned during insertion, in the update case, it just has to look for the right IDs.

How to go about this?

Asking because I am only familiar with updating and inserting single lines into a table. One could loop in C# over the datatable t of course and insert or update line by line, but this would probably be slow. Is there a way to write an SQL query like this somehow:

Insert Into SQLTable Values (@t)

?

And Update like this:

Update SQLTable SET ... Where C1 = @t.C1

Or something like that.

I know that SQL server can create automatic update and insert queries and that you can then type things in C# like

Adapter.Update(t);

But, this has proven to be super slow on our server, for unknown reasons. I have asked on this forum and got some answers from experts, but was not able to srot out the problem.

How can we write

Gridview Header & table data alignment problem

  

Hi,


Newbie to ASP.net. Programming in C#.

I'm querying a SQL database and displaying the results in a gridview.

The results can be many records so I need to provide the facility to scroll. To display the headers when scroling I have implemented ( in my asp code) the headers in another table and the data is in another table. I see now I cannot align the column headers with the table data.

Appreciate any help to fix this issue.

If this method is not a good one to display headers with data please suggest another method.( Some example code guidance would really help)


Here is my ASP code.

<div id="divProjectTableHeaderFullDetail" runat="server" style="background-color: #993300;
            height: 40px; width: 770px; margin: 0;  padding: 0 ; " >
            <table style="font-family: Arial; font-size: 10pt; color: white;" cellspacing="0"
                cellpadding="0">
                <tr>
        &n

Editing the Data in a GridView

  
In addition to deleting a GridView's underlying data, another common need is to allow end users to edit the data displayed in a GridView. With ASP.NET 1.x's DataGrid control, editing the data is certainly possible, but requires creating three event handlers and writing a dozen or so lines of code. With the GridView and ASP.NET 2.0, it is possible to create an editable GridView without writing a single line of code! All of the necessary functionality is encapsulated within the GridView.

The GridView allows editing on a row-by-row basis. An editable GridView contains an additional column with an Edit button in each row. When the end user clicks on an Edit button that row becomes editable, causing the Edit button to change to Update and Cancel buttons and the other columns to become TextBoxes. The end user can then update one or more column values and click Update to save their changes.

ASP.Net Gridview Edit Update Cancel Commands

  
In ASP.Net 2.0, GridView Control also provides the functionality to edit and update the data retrieved from the database using CommandField template. You can cancel the action using Cancel Command of the CommandField. GridView consists of events that can be used to perform the actions like edit, update and cancel upon the Data items displayed in the ASP.Net GridView Data Control.

How to format and update GridView and DataGrid rows using JQuery

  
The behavior described in this question is as expected. When you set text of a cell in grid, it directly affects HTML that is going to be rendered. When you set text value of a cell, it means that you are setting innerText of the cell. The column that GridView creates for command fields (Edit, Delete and Select) are a (anchor) or button elements. So you can see what will happen if you set text value in that cell. It will wipe out those link or button controls and replace them with simple text string.

Display data in gridview dynamicallay

  
I have AD domain which has 100000 users, I want to display all the users in gridview controls.Actually it is displaying users in gridview after parsing entire domain which takes around 30 min. I want to display the users while loading itself.It is continously getting user information from AD domain and getting each user details, I want to display the users information which already queried instead of waiting till getting all users information

asp.net display data in gridview

  
i want to display data in gridview binded to a sql datasource
but the problem part is i want to bind a field of that datasource to a dropdownlist and when a item is selected in that dropdownlist then correcposnding to that data will be displayed in gridview...
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