473,320 Members | 1,896 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,320 software developers and data experts.

Newvalues in a gridview

20
Hi Gurus

I have created a small application to load data into a gridview from a dataset. Now I want to update the data set but when I try to use the keys() and the newvalues() arrays they all do not contain any data. I am biding the gridview in code. How do I enable my gridview to populate the keys() and the newvalues collections in a gridview that i set properties programmatically. I am using vb.net
Nov 11 '08 #1
3 1017
Murugs
18
Can you put the sample code?
Nov 11 '08 #2
Garudzo
20
Can you put the sample code?
After filligng my datest called dsenrol I have the following code.

Expand|Select|Wrap|Line Numbers
  1. GridView1.DataSource = DsEnrol
  2.             GridView1.AutoGenerateColumns = "False"
  3.             GridView1.DataKeyNames = New String() {"Institution_id", "Year_id", "field1"}
  4.             GridView1.DataBind()
I have edited the grid colums and specified the fields I want to show in the grid.
Nov 11 '08 #3
Murugs
18
Hi,
//GridView1.DataKeyNames = New String() {"Institution_id", "Year_id", "field1"}
what exactly u r trying to do in this line.
Is all the three columns are primary columns?
r u using the below code to get datakey values?
//Gridview1.DataKeys
can you post all the code so that we can sense the exact error?

Thanks,
Murugs.
Nov 11 '08 #4

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

Similar topics

3
by: Michael Glass | last post by:
I'm working on an ASP.Net web app using VS2005 and the .Net 2.0 framework, and I have a serious problem with the page I'm currently working on. The page has, among other things, two FormViews and a...
5
by: Mark Olbert | last post by:
I ran into a situation this morning where the RowUpdating event of a GridView kept insisting there were no entries in either the OldValues or NewValues dictionaries. The GridView is bound to a...
0
by: Michael | last post by:
Hi I'm having a problem getting the newvalues or oldvalues from the RowUpdating event. I have the following code for the event(See note): Protected Sub grdPOs_RowUpdating(ByVal sender As Object,...
0
by: Michael | last post by:
Hi I'm having a problem getting the newvalues or oldvalues from the RowUpdating event. I have the following code for the event(See note): Protected Sub grdPOs_RowUpdating(ByVal sender As Object,...
0
by: loga123 | last post by:
Hi All, I am using asp.net 2.0. I have a gridview with AutoGenerateEditButton="True" . I am trying to access newValues in rowupdating event. It gives me "oldvalues" collection. I have a)...
0
by: loga123 | last post by:
Hi All, I am using asp.net 2.0. I have a gridview with AutoGenerateEditButton="True" . I am trying to access newValues in rowupdating event. It gives me "oldvalues" collection. I have a)...
1
by: s.bussing | last post by:
Hi, I have been struggling with the GridView the whole day, but can not get this solved. The rowupdating event in my Gridview doesn't give me the new values only the old ones. In my GridView I...
3
by: Haleigh | last post by:
I just started a few days ago, so I'm very new to this. I'm trying to update a gridview using a store procedure. When I am in the update subroutine, newvalues and oldvalues are empty, plus count is...
0
by: lightgram | last post by:
Hello I am having problems extracting the OldValues collection from the RowUpdating event in my GridView. Every time I access this I am getting the values from the NewValues collection in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.