473,385 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Updating array

tsubasa
64
I have an array that is in C# using the .Net framwork and I have the code to delete items from the array, but I am trying to figure out how to update an item in the array.

Expand|Select|Wrap|Line Numbers
  1.  
  2. public DataSet GetDataSetCar()
  3.     {
  4.         if (Session["car"] == null)
  5.         {
  6.             DataSet ds = new DataSet();
  7.             DataColumn colID = new DataColumn("ID_Product", System.Type.GetType("System.Int32"), "");
  8.             DataTable dt = new DataTable("Car");
  9.             dt.Columns.Add(colID);
  10.             dt.Columns.Add("Name_Product", System.Type.GetType("System.String"), "");
  11.             dt.Columns.Add("Quantity", System.Type.GetType("System.Int32"), "");
  12.             dt.Columns.Add("Value", System.Type.GetType("System.Double"), "");
  13.             dt.Columns.Add("SubTotal", System.Type.GetType("System.Double"), "Quantity*Value");
  14.             dt.Columns.Add("Total", System.Type.GetType("System.Double"), "SUM(SubTotal)");
  15.             //key field
  16.             DataColumn[] keys = new DataColumn[1];
  17.             keys[0] = colID;
  18.             dt.PrimaryKey = keys;
  19.             ds.Tables.Add(dt);
  20.             Session["car"] = ds;
  21.             return ds;
  22.         }
  23.         else
  24.         {
  25.             return (Session["car"] as DataSet);
  26.         }
  27.     }
  28.  
Kind Regards,

-Tsubasa
Sep 10 '13 #1
0 1012

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Håvard Olerud Eriksen | last post by:
I've been working on a webshop, and I've got most of the functionality up and running. One problem, however, that I don't seem to be able to solve is as follows. My shopping cart is stored in...
11
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
1
by: Sure | last post by:
Hello All, I want to update a form using the LWP & HTTP method. It was working fine when I am updating the values like this $ua = LWP::UserAgent->new; $url...
3
by: Mark A Framness | last post by:
Greetings, I am working on a project and we need to write a conversion script to initialize a new field on a table. The number of records on this table is on the order of millions so routine...
2
by: JohnK | last post by:
this is what I'm trying to do: myActionQuery = "UPDATE MyTable SET " & _ ", Data = " & mData & _ " Where ObjectID = " & mObjectID where mData is an array of bytes this is the error msg I'm...
24
by: RyanTaylor | last post by:
I have a final coming up later this week in my beginning Java class and my prof has decided to give us possible Javascript code we may have to write. Problem is, we didn't really cover JS and what...
6
by: sgottenyc | last post by:
Hello, If you could assist me with the following situation, I would be very grateful. I have a table of data retrieved from database displayed on screen. To each row of data, I have added...
10
by: chimambo | last post by:
Hi All, I have a little problem. I am retrieving records from a table and I want to update the records using checkboxes. I am able to display the database record quite alright and I have created...
20
by: Xcriber51 | last post by:
Hi -- I'm not entirely familiar with the norms and standard libraries of JavaScript so if the answer to this is yesterday's news, please ignore. I'm trying to write a simple text formatting...
5
stepterr
by: stepterr | last post by:
I have a form that is built based on a query. Everything is working except when I submit the form the radio buttons are only updating the first row in my database. dcategory and dthumbnail are two...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.